fix more issues reported by coverity

This commit is contained in:
David Hrdlička
2020-01-15 18:48:22 +01:00
parent 94ba8ec38c
commit a575bd7e8b
9 changed files with 23 additions and 13 deletions

View File

@@ -10,12 +10,12 @@
*
* Version: @(#)prt_escp.c 1.0.7 2019/09/23
*
* Authors: Michael Dr<44>ing, <michael@drueing.de>
* Authors: Michael Dr<44>ing, <michael@drueing.de>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Based on code by Frederic Weymann (originally for DosBox.)
*
* Copyright 2018,2019 Michael Dr<44>ing.
* Copyright 2018,2019 Michael Dr<44>ing.
* Copyright 2019,2019 Fred N. van Kempen.
*
* Redistribution and use in source and binary forms, with
@@ -2058,6 +2058,11 @@ escp_init(void *lpt)
dev->lpt = lpt;
/* Create a full pathname for the font files. */
if(wcslen(exe_path) >= sizeof_w(dev->fontpath)) {
free(dev);
return(NULL);
}
wcscpy(dev->fontpath, exe_path);
plat_path_slash(dev->fontpath);
wcscat(dev->fontpath, L"roms/printer/fonts/");