openbsd-ports/devel/gputils/patches/patch-libgputils_gpwritehex_c
naddy cfb6182a3f Import gputils 0.11.7.
Submitted by Andrew Dalgleish <openbsd@ajd.net.au>.

GPUTILS is a collection of tools for the Microchip (TM) PIC
microcontrollers. It includes gpasm, gplink, and gplib.
2003-11-03 01:02:34 +00:00

23 lines
867 B
Plaintext

$OpenBSD: patch-libgputils_gpwritehex_c,v 1.1.1.1 2003/11/03 01:02:36 naddy Exp $
--- libgputils/gpwritehex.c.orig 2003-10-14 22:34:32.000000000 +1000
+++ libgputils/gpwritehex.c 2003-10-14 22:36:08.000000000 +1000
@@ -183,12 +183,12 @@ int writehex (char *basefilename,
}
/* build file names */
- strcpy(hexfilename, basefilename);
- strcat(hexfilename, ".hex");
- strcpy(lowhex, basefilename);
- strcat(lowhex, ".hxl");
- strcpy(highhex, basefilename);
- strcat(highhex, ".hxh");
+ strlcpy(hexfilename, basefilename, sizeof(hexfilename));
+ strlcat(hexfilename, ".hex", sizeof(hexfilename));
+ strlcpy(lowhex, basefilename, sizeof(lowhex));
+ strlcat(lowhex, ".hxl", sizeof(lowhex));
+ strlcpy(highhex, basefilename, sizeof(highhex));
+ strlcat(highhex, ".hxh", sizeof(highhex));
if (numerrors) {
/* Remove the hex files (if any) */