openbsd-ports/x11/xwrits/patches/patch-giftoc_c
jasper aa9c774ee4 - update xwrits to 2.24
- remove NO_REGRESS
- regen patches
- reformat DESCR

from new MAINTAINER, Scott Vokes, with tweaks by me
2007-07-18 09:58:22 +00:00

24 lines
999 B
Plaintext

$OpenBSD: patch-giftoc_c,v 1.1 2007/07/18 09:58:22 jasper Exp $
--- giftoc.c.orig Thu Aug 28 23:58:00 2003
+++ giftoc.c Thu Jul 12 18:52:46 2007
@@ -153,7 +153,7 @@ main(int argc, char *argv[])
if (directory[ strlen(directory) - 1 ] != PATHNAME_SEPARATOR
&& directory[0]) {
char *ndirectory = (char *)fmalloc(strlen(directory) + 2);
- sprintf(ndirectory, "%s%c", directory, PATHNAME_SEPARATOR);
+ snprintf(ndirectory, strlen(directory) + 2, "%s%c", directory, PATHNAME_SEPARATOR);
directory = ndirectory;
}
} else
@@ -178,8 +178,8 @@ or: giftoc -makename [OPTIONS] FILE [FILE...]\n\
char *rec_name = 0;
char *file_name = (char *)fmalloc(strlen(argv[0]) + strlen(directory) + 1);
- strcpy(file_name, directory);
- strcat(file_name, argv[0]);
+ strlcpy(file_name, directory, strlen(argv[0]) + strlen(directory) + 1);
+ strlcat(file_name, argv[0], strlen(argv[0]) + strlen(directory) + 1);
f = fopen(file_name, "rb");
if (!f) {