Update of /cvsroot/cscope/cscope/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4099/src
Modified Files:
build.c command.c dir.c display.c edit.c exec.c find.c
global.h main.c Makefile.am Makefile.in vpaccess.c vpfopen.c
vpopen.c
Added Files:
snprintf.c
Log Message:
Replace all usage of (v)sprintf by (v)snprintf.
Supply and use optional replacement snprintf on systems that don't have it.
--- NEW FILE ---
/* $Id: snprintf.c,v 1.1 2009/04/10 13:39:23 broeker Exp $ */
/*
* Copyright (c) 1995 Patrick Powell.
*
* This code is based on code written by Patrick Powell <papowell@...>.
* It may be used for any purpose as long as this notice remains intact on all
* source code distributions.
*/
/*
* Copyright (c) 2008 Holger Weiss.
*
* This version of the code is maintained by Holger Weiss <holger@...>.
* My changes to the code may freely be used, modified and/or redistributed for
* any purpose. It would be nice if additions and fixes to this file (including
* trivial code cleanups) would be sent back in order to let me include them in
* the version available at <http://www.jhweiss.de/software/snprintf.html>.
* However, this is not a requirement for using or redistributing (possibly
[...2058 lines suppressed...]
#if !OS_SYSV /* SysV uses a different format than we do. */
TEST(pointer_fmt, pointer_val);
#endif /* !OS_SYSV */
(void)printf("Result: %d out of %d tests failed.\n", failed, num);
(void)fputs("Checking how many digits we support: ", stdout);
for (i = 0; i < 100; i++) {
value = pow(10, i) * digits;
(void)sprintf(buf1, "%.1f", value);
(void)snprintf(buf2, sizeof(buf2), "%.1f", value);
if (strcmp(buf1, buf2) != 0) {
(void)printf("apparently %d.\n", i);
break;
}
}
return (failed == 0) ? 0 : 1;
}
#endif /* TEST_SNPRINTF */
/* vim: set joinspaces textwidth=80: */
Index: build.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/build.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** build.c 12 Mar 2008 22:40:47 -0000 1.14
--- build.c 10 Apr 2009 13:39:23 -0000 1.15
***************
*** 224,228 ****
strcpy(newdir, "$HOME");
} else if (strncmp(currentdir, home, strlen(home)) == 0) {
! sprintf(newdir, "$HOME%s", currentdir + strlen(home));
}
/* sort the source file names (needed for rebuilding) */
--- 224,228 ----
strcpy(newdir, "$HOME");
} else if (strncmp(currentdir, home, strlen(home)) == 0) {
! snprintf(newdir, sizeof(newdir), "$HOME%s", currentdir + strlen(home));
}
/* sort the source file names (needed for rebuilding) */
***************
*** 457,461 ****
fstat(fileno(postings), &statstruct);
fclose(postings);
! sprintf(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");
--- 457,461 ----
fstat(fileno(postings), &statstruct);
fclose(postings);
! 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");
Index: command.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/command.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** command.c 20 Aug 2006 15:00:33 -0000 1.32
--- command.c 10 Apr 2009 13:39:23 -0000 1.33
***************
*** 740,744 ****
/* make sure it can be changed */
if (access(newfile, WRITE) != 0) {
! sprintf(msg, "Cannot write to file %s", newfile);
postmsg(msg);
anymarked = NO;
--- 740,744 ----
/* make sure it can be changed */
if (access(newfile, WRITE) != 0) {
! snprintf(msg, sizeof(msg), "Cannot write to file %s", newfile);
postmsg(msg);
anymarked = NO;
Index: dir.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/dir.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** dir.c 14 Feb 2008 12:39:37 -0000 1.30
--- dir.c 10 Apr 2009 13:39:23 -0000 1.31
***************
*** 141,145 ****
/* compute its path from higher view path source dirs */
for (i = 1; i < nvpsrcdirs; ++i) {
! sprintf(path, "%.*s/%s",
PATHLEN - 2 - dir_len,
srcdirs[i], dir);
--- 141,145 ----
/* compute its path from higher view path source dirs */
for (i = 1; i < nvpsrcdirs; ++i) {
! snprintf(path, sizeof(path), "%.*s/%s",
PATHLEN - 2 - dir_len,
srcdirs[i], dir);
***************
*** 209,213 ****
/* compute its path from higher view path source dirs */
for (i = 1; i < nvpsrcdirs; ++i) {
! sprintf(path, "%.*s/%s",
PATHLEN - 2 - dir_len,
srcdirs[i], dir);
--- 209,213 ----
/* compute its path from higher view path source dirs */
for (i = 1; i < nvpsrcdirs; ++i) {
! snprintf(path, sizeof(path), "%.*s/%s",
PATHLEN - 2 - dir_len,
srcdirs[i], dir);
***************
*** 496,500 ****
struct stat buf;
! sprintf(path,"%s/%.*s", adir,
PATHLEN - 2 - adir_len,
entry->d_name);
--- 496,500 ----
struct stat buf;
! snprintf(path, sizeof(path), "%s/%.*s", adir,
PATHLEN - 2 - adir_len,
entry->d_name);
***************
*** 608,612 ****
for (i = 0; i < nincdirs; ++i) {
/* don't include the file from two directories */
! sprintf(name, "%.*s/%s",
PATHLEN - 2 - file_len, incnames[i],
file);
--- 608,612 ----
for (i = 0; i < nincdirs; ++i) {
/* don't include the file from two directories */
! snprintf(name, sizeof(name), "%.*s/%s",
PATHLEN - 2 - file_len, incnames[i],
file);
***************
*** 615,619 ****
}
/* make sure it exists and is readable */
! sprintf(path, "%.*s/%s",
PATHLEN - 2 - file_len, incdirs[i],
file);
--- 615,619 ----
}
/* make sure it exists and is readable */
! snprintf(path, sizeof(path), "%.*s/%s",
PATHLEN - 2 - file_len, incdirs[i],
file);
***************
*** 679,683 ****
/* compute its path from higher view path source dirs */
for (i = 1; i < nvpsrcdirs; ++i) {
! sprintf(path, "%.*s/%s",
PATHLEN - 2 - file_len, srcdirs[i],
file);
--- 679,683 ----
/* compute its path from higher view path source dirs */
for (i = 1; i < nvpsrcdirs; ++i) {
! snprintf(path, sizeof(path), "%.*s/%s",
PATHLEN - 2 - file_len, srcdirs[i],
file);
Index: display.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/display.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** display.c 20 Aug 2006 15:00:34 -0000 1.29
--- display.c 10 Apr 2009 13:39:23 -0000 1.30
***************
*** 479,496 ****
if ((c = getc(refsfound)) == EOF) {
if (findresult != NULL) {
! (void) sprintf(lastmsg, "Egrep %s in this pattern: %s",
findresult, Pattern);
} else if (rc == NOTSYMBOL) {
! (void) sprintf(lastmsg, "This is not a C symbol: %s",
Pattern);
} else if (rc == REGCMPERROR) {
! (void) sprintf(lastmsg, "Error in this regcomp(3) regular expression: %s",
Pattern);
} else if (funcexist == NO) {
! (void) sprintf(lastmsg, "Function definition does not exist: %s",
Pattern);
} else {
! (void) sprintf(lastmsg, "Could not find the %s: %s",
fields[field].text2, Pattern);
}
--- 479,496 ----
if ((c = getc(refsfound)) == EOF) {
if (findresult != NULL) {
! (void) snprintf(lastmsg, sizeof(lastmsg), "Egrep %s in this pattern: %s",
findresult, Pattern);
} else if (rc == NOTSYMBOL) {
! (void) snprintf(lastmsg, sizeof(lastmsg), "This is not a C symbol: %s",
Pattern);
} else if (rc == REGCMPERROR) {
! (void) snprintf(lastmsg, sizeof(lastmsg), "Error in this regcomp(3) regular expression: %s",
Pattern);
} else if (funcexist == NO) {
! (void) snprintf(lastmsg, sizeof(lastmsg), "Function definition does not exist: %s",
Pattern);
} else {
! (void) snprintf(lastmsg, sizeof(lastmsg), "Could not find the %s: %s",
fields[field].text2, Pattern);
}
***************
*** 528,535 ****
clrtoeol();
addstr(what);
! sprintf(msg, "%ld", current);
move(MSGLINE, (COLS / 2) - (strlen(msg) / 2));
addstr(msg);
! sprintf(msg, "%ld", max);
move(MSGLINE, COLS - strlen(msg));
addstr(msg);
--- 528,535 ----
clrtoeol();
addstr(what);
! snprintf(msg, sizeof(msg), "%ld", current);
move(MSGLINE, (COLS / 2) - (strlen(msg) / 2));
addstr(msg);
! snprintf(msg, sizeof(msg), "%ld", max);
move(MSGLINE, COLS - strlen(msg));
addstr(msg);
***************
*** 538,542 ****
else if (verbosemode == YES)
{
! sprintf(msg, "> %s %ld of %ld", what, current, max);
}
--- 538,542 ----
else if (verbosemode == YES)
{
! snprintf(msg, sizeof(msg), "> %s %ld of %ld", what, current, max);
}
***************
*** 576,580 ****
}
#endif
! (void) sprintf(msg, "%s: %s", text, s);
postmsg(msg);
}
--- 576,580 ----
}
#endif
! (void) snprintf(msg, sizeof(msg), "%s: %s", text, s);
postmsg(msg);
}
***************
*** 648,656 ****
(void) fputc('\n', stderr);
} else {
- #if HAVE_VSNPRINTF
vsnprintf(errbuf, sizeof(errbuf), msg, ap);
- #else
- vsprintf(errbuf, msg, ap);
- #endif
postmsg2(errbuf);
}
--- 648,652 ----
***************
*** 665,673 ****
va_start(ap, msg);
- #if HAVE_VSNPRINTF
vsnprintf(errbuf, sizeof(errbuf), msg, ap);
- #else
- vsprintf(errbuf, msg, ap);
- #endif
/* restore the terminal to its original mode */
if (incurses == YES) {
--- 661,665 ----
Index: edit.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/edit.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** edit.c 20 Aug 2006 15:00:34 -0000 1.6
--- edit.c 10 Apr 2009 13:39:23 -0000 1.7
***************
*** 106,112 ****
file = filepath(file);
! (void) sprintf(msg, "%s +%s %s", mybasename(editor), linenum, file);
postmsg(msg);
! (void) sprintf(plusnum, lineflag, linenum);
/* if this is the more or page commands */
if (strcmp(s = mybasename(editor), "more") == 0 || strcmp(s, "page") == 0) {
--- 106,112 ----
file = filepath(file);
! (void) snprintf(msg, sizeof(msg), "%s +%s %s", mybasename(editor), linenum, file);
postmsg(msg);
! (void) snprintf(plusnum, sizeof(plusnum), lineflag, linenum);
/* if this is the more or page commands */
if (strcmp(s = mybasename(editor), "more") == 0 || strcmp(s, "page") == 0) {
***************
*** 133,137 ****
if (prependpath != NULL && *file != '/') {
! (void) sprintf(path, "%s/%s", prependpath, file);
file = path;
}
--- 133,137 ----
if (prependpath != NULL && *file != '/') {
! (void) snprintf(path, sizeof(path), "%s/%s", prependpath, file);
file = path;
}
Index: exec.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/exec.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** exec.c 11 Apr 2008 11:23:55 -0000 1.11
--- exec.c 10 Apr 2009 13:39:23 -0000 1.12
***************
*** 124,128 ****
/* execute the program or shell script */
execvp(a, args); /* returns only on failure */
! sprintf(msg, "\nCannot exec %s", a);
perror(msg); /* display the reason */
askforreturn(); /* wait until the user sees the message */
--- 124,128 ----
/* execute the program or shell script */
execvp(a, args); /* returns only on failure */
! snprintf(msg, sizeof(msg), "\nCannot exec %s", a);
perror(msg); /* display the reason */
askforreturn(); /* wait until the user sees the message */
Index: find.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/find.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** find.c 20 Aug 2006 19:15:54 -0000 1.20
--- find.c 10 Apr 2009 13:39:23 -0000 1.21
***************
*** 674,678 ****
/* note: regcomp doesn't recognize ^*keypad$ as a syntax error
unless it is given as a single arg */
! (void) sprintf(buf, "^%s$", s);
if (regcomp (®exp, buf, REG_EXTENDED | REG_NOSUB) != 0) {
return(REGCMPERROR);
--- 674,678 ----
/* note: regcomp doesn't recognize ^*keypad$ as a syntax error
unless it is given as a single arg */
! (void) snprintf(buf, sizeof(buf), "^%s$", s);
if (regcomp (®exp, buf, REG_EXTENDED | REG_NOSUB) != 0) {
return(REGCMPERROR);
Index: global.h
===================================================================
RCS file: /cvsroot/cscope/cscope/src/global.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** global.h 30 Jun 2008 21:16:02 -0000 1.36
--- global.h 10 Apr 2009 13:39:23 -0000 1.37
***************
*** 95,98 ****
--- 95,114 ----
#endif
+ #if HAVE_STDARG_H
+ #include <stdarg.h>
+ #if !HAVE_VSNPRINTF
+ int rpl_vsnprintf(char *, size_t, const char *, va_list);
+ #endif
+ #if !HAVE_SNPRINTF
+ int rpl_snprintf(char *, size_t, const char *, ...);
+ #endif
+ #if !HAVE_VASPRINTF
+ int rpl_vasprintf(char **, const char *, va_list);
+ #endif
+ #if !HAVE_ASPRINTF
+ int rpl_asprintf(char **, const char *, ...);
+ #endif
+ #endif /* HAVE_STDARG_H */
+
/* FIXME: this testing for platforms is foolish. Stop it! */
#if BSD
Index: main.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/main.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -r1.45 -r1.46
*** main.c 11 Apr 2008 11:23:55 -0000 1.45
--- main.c 10 Apr 2009 13:39:23 -0000 1.46
***************
*** 356,360 ****
orig_umask = umask(S_IRWXG|S_IRWXO);
pid = getpid();
! sprintf(tempdirpv, "%s/cscope.%d", tmpdir, pid);
if(mkdir(tempdirpv,S_IRWXU)) {
fprintf(stderr, "\
--- 356,360 ----
orig_umask = umask(S_IRWXG|S_IRWXO);
pid = getpid();
! snprintf(tempdirpv, sizeof(tempdirpv), "%s/cscope.%d", tmpdir, pid);
if(mkdir(tempdirpv,S_IRWXU)) {
fprintf(stderr, "\
***************
*** 365,370 ****
umask(orig_umask);
! sprintf(temp1, "%s/cscope.1", tempdirpv);
! sprintf(temp2, "%s/cscope.2", tempdirpv);
/* if running in the foreground */
--- 365,370 ----
umask(orig_umask);
! snprintf(temp1, sizeof(temp1), "%s/cscope.1", tempdirpv);
! snprintf(temp2, sizeof(temp2), "%s/cscope.2", tempdirpv);
/* if running in the foreground */
***************
*** 389,398 ****
* the home directory
*/
! sprintf(path, "%s/%s", home, reffile);
if (isuptodate == NO || access(path, READ) == 0) {
reffile = my_strdup(path);
! sprintf(path, "%s/%s", home, invname);
invname = my_strdup(path);
! sprintf(path, "%s/%s", home, invpost);
invpost = my_strdup(path);
}
--- 389,398 ----
* the home directory
*/
! snprintf(path, sizeof(path), "%s/%s", home, reffile);
if (isuptodate == NO || access(path, READ) == 0) {
reffile = my_strdup(path);
! snprintf(path, sizeof(path), "%s/%s", home, invname);
invname = my_strdup(path);
! snprintf(path, sizeof(path), "%s/%s", home, invpost);
invpost = my_strdup(path);
}
***************
*** 735,754 ****
cannotwrite(char *file)
{
- #if HAVE_SNPRINTF
char msg[MSGLEN + 1];
snprintf(msg, sizeof(msg), "Removed file %s because write failed", file);
- #else
- char *msg = mymalloc(50 + strlen(file));
-
- sprintf(msg, "Removed file %s because write failed", file);
- #endif
myperror(msg); /* display the reason */
- #if !HAVE_SNPRINTF
- free(msg);
- #endif
-
unlink(file);
myexit(1); /* calls exit(2), which closes files */
--- 735,744 ----
Index: Makefile.am
===================================================================
RCS file: /cvsroot/cscope/cscope/src/Makefile.am,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** Makefile.am 30 Sep 2006 20:29:14 -0000 1.12
--- Makefile.am 10 Apr 2009 13:39:23 -0000 1.13
***************
*** 30,34 ****
LEXLIB = @LEXLIB@
! cscope_LDADD = $(CURSES_LIBS) $(LEXLIB)
AM_CPPFLAGS = $(CURSES_INCLUDEDIR)
--- 30,34 ----
LEXLIB = @LEXLIB@
! cscope_LDADD = $(CURSES_LIBS) $(LEXLIB) $(LIBOBJS)
AM_CPPFLAGS = $(CURSES_INCLUDEDIR)
Index: Makefile.in
===================================================================
RCS file: /cvsroot/cscope/cscope/src/Makefile.in,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** Makefile.in 30 Jun 2008 21:36:48 -0000 1.15
--- Makefile.in 10 Apr 2009 13:39:23 -0000 1.16
***************
*** 42,48 ****
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in egrep.c \
! fscanner.c scanner.c
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
! am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
--- 42,49 ----
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in egrep.c \
! fscanner.c scanner.c snprintf.c
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
! am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
! $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
***************
*** 73,77 ****
cscope_OBJECTS = $(am_cscope_OBJECTS)
am__DEPENDENCIES_1 =
! cscope_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
am__gscope_SOURCES_DIST = gscope.c fscanner.l scanner.l egrep.y \
alloc.c alloc.h basename.c build.c build.h command.c compath.c \
--- 74,80 ----
cscope_OBJECTS = $(am_cscope_OBJECTS)
am__DEPENDENCIES_1 =
! am__DEPENDENCIES_2 = @LIBOBJS@
! cscope_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
! $(am__DEPENDENCIES_2)
am__gscope_SOURCES_DIST = gscope.c fscanner.l scanner.l egrep.y \
alloc.c alloc.h basename.c build.c build.h command.c compath.c \
***************
*** 236,240 ****
EXTRA_cscope_SOURCES = scanner.l fscanner.l
! cscope_LDADD = $(CURSES_LIBS) $(LEXLIB)
AM_CPPFLAGS = $(CURSES_INCLUDEDIR)
CLEANFILES = scanner.c fscanner.c egrep.c
--- 239,243 ----
EXTRA_cscope_SOURCES = scanner.l fscanner.l
! cscope_LDADD = $(CURSES_LIBS) $(LEXLIB) $(LIBOBJS)
AM_CPPFLAGS = $(CURSES_INCLUDEDIR)
CLEANFILES = scanner.c fscanner.c egrep.c
***************
*** 317,320 ****
--- 320,324 ----
-rm -f *.tab.c
+ @AMDEP_TRUE@...@ @am__quote@...@
@AMDEP_TRUE@...@ @am__quote@...@
@AMDEP_TRUE@...@ @am__quote@...@
***************
*** 917,921 ****
distclean: distclean-am
! -rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
--- 921,925 ----
distclean: distclean-am
! -rm -rf $(DEPDIR) ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
***************
*** 943,947 ****
maintainer-clean: maintainer-clean-am
! -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
--- 947,951 ----
maintainer-clean: maintainer-clean-am
! -rm -rf $(DEPDIR) ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
Index: vpaccess.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/vpaccess.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** vpaccess.c 3 May 2000 22:02:10 -0000 1.2
--- vpaccess.c 10 Apr 2009 13:39:23 -0000 1.3
***************
*** 50,54 ****
vpinit(NULL);
for (i = 1; i < vpndirs; i++) {
! (void) sprintf(buf, "%s/%s", vpdirs[i], path);
if ((returncode = access(buf, amode)) != -1) {
break;
--- 50,54 ----
vpinit(NULL);
for (i = 1; i < vpndirs; i++) {
! (void) snprintf(buf, sizeof(buf), "%s/%s", vpdirs[i], path);
if ((returncode = access(buf, amode)) != -1) {
break;
Index: vpfopen.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/vpfopen.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** vpfopen.c 27 Mar 2001 14:09:19 -0000 1.3
--- vpfopen.c 10 Apr 2009 13:39:23 -0000 1.4
***************
*** 54,58 ****
vpinit(NULL);
for (i = 1; i < vpndirs; i++) {
! (void) sprintf(buf, "%s/%s", vpdirs[i], filename);
if ((returncode = myfopen(buf, type)) != NULL) {
break;
--- 54,58 ----
vpinit(NULL);
for (i = 1; i < vpndirs; i++) {
! (void) snprintf(buf, sizeof(buf), "%s/%s", vpdirs[i], filename);
if ((returncode = myfopen(buf, type)) != NULL) {
break;
Index: vpopen.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/vpopen.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** vpopen.c 28 Jul 2002 15:40:07 -0000 1.4
--- vpopen.c 10 Apr 2009 13:39:23 -0000 1.5
***************
*** 53,57 ****
vpinit(NULL);
for (i = 1; i < vpndirs; i++) {
! (void) sprintf(buf, "%s/%s", vpdirs[i], path);
if ((returncode = myopen(buf, oflag, 0666)) != -1) {
break;
--- 53,57 ----
vpinit(NULL);
for (i = 1; i < vpndirs; i++) {
! (void) snprintf(buf, sizeof(buf), "%s/%s", vpdirs[i], path);
if ((returncode = myopen(buf, oflag, 0666)) != -1) {
break;
|