1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
$NetBSD: patch-ae,v 1.10 2007/01/06 22:45:49 wiz Exp $
--- src/build.c.orig 2006-09-30 10:13:00.000000000 +0200
+++ src/build.c
@@ -223,7 +223,7 @@ build(void)
if (strcmp(currentdir, home) == 0) {
strcpy(newdir, "$HOME");
} else if (strncmp(currentdir, home, strlen(home)) == 0) {
- sprintf(newdir, "$HOME%s", currentdir + strlen(home));
+ snprintf(newdir, sizeof(newdir), "$HOME%s", currentdir + strlen(home));
}
/* sort the source file names (needed for rebuilding) */
qsort(srcfiles, nsrcfiles, sizeof(char *), compare);
@@ -454,7 +454,7 @@ cscope: converting to new symbol databas
}
fstat(fileno(postings), &statstruct);
fclose(postings);
- sprintf(sortcommand, "env LC_ALL=C sort -T %s %s", tmpdir, temp1);
+ snprintf(sortcommand, sizeof(sortcommand), "env LC_ALL=C sort -T %s %s", tmpdir, temp1);
if ((postings = mypopen(sortcommand, "r")) == NULL) {
fprintf(stderr, "cscope: cannot open pipe to sort command\n");
cannotindex();
|