As far as I understand the code there's no reason that opencvs should silently
go on
if snprintf() can't construct the tagpath in cvs_parse_tagfile() and
cvs_write_tagfile().
Index: entries.c
===================================================================
RCS file: /cvs/src/usr.bin/cvs/entries.c,v
retrieving revision 1.102
diff -u -p -r1.102 entries.c
--- entries.c 19 Mar 2009 09:53:16 -0000 1.102
+++ entries.c 10 Jun 2010 11:55:44 -0000
@@ -419,7 +419,7 @@ void
cvs_parse_tagfile(char *dir, char **tagp, char **datep, int *nbp)
{
FILE *fp;
- int i, linenum;
+ int linenum;
size_t len;
struct tm datetm;
char linebuf[128], tagpath[MAXPATHLEN];
@@ -435,9 +435,7 @@ cvs_parse_tagfile(char *dir, char **tagp
if (nbp != NULL)
*nbp = 0;
- i = snprintf(tagpath, MAXPATHLEN, "%s/%s", dir, CVS_PATH_TAG);
- if (i < 0 || i >= MAXPATHLEN)
- return;
+ (void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", dir, CVS_PATH_TAG);
if ((fp = fopen(tagpath, "r")) == NULL) {
if (errno != ENOENT)
@@ -502,7 +500,6 @@ cvs_write_tagfile(const char *dir, char
char tagpath[MAXPATHLEN];
char sticky[CVS_REV_BUFSZ];
struct tm datetm;
- int i;
cvs_log(LP_TRACE, "cvs_write_tagfile(%s, %s, %s)", dir,
tag != NULL ? tag : "", date != NULL ? date : "");
@@ -510,9 +507,7 @@ cvs_write_tagfile(const char *dir, char
if (cvs_noexec == 1)
return;
- i = snprintf(tagpath, MAXPATHLEN, "%s/%s", dir, CVS_PATH_TAG);
- if (i < 0 || i >= MAXPATHLEN)
- return;
+ (void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", dir, CVS_PATH_TAG);
if (tag != NULL || cvs_specified_date != -1 ||
cvs_directory_date != -1) {