mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtsr: Coverity fixes for string buffer issues
This commit is contained in:
parent
3cf92f3741
commit
a1fb026d86
5 changed files with 6 additions and 6 deletions
|
@ -1044,7 +1044,7 @@ int main (int argc, char *argv[])
|
|||
fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 13,
|
||||
"%s: Using DBFPATH = '%s'.\n") ,
|
||||
aa_argv0, ptr);
|
||||
strcpy (full_dbname_old, ptr);
|
||||
snprintf(full_dbname_old, sizeof(full_dbname_old), "%s", ptr);
|
||||
|
||||
/* Ensure that DBFPATH ends in a slash. */
|
||||
ptr = strchr (full_dbname_old, '\0');
|
||||
|
|
|
@ -319,7 +319,7 @@ int main (int argc, char *argv[])
|
|||
"USAGE: %s <dbname>\n"), aa_argv0);
|
||||
return 2;
|
||||
}
|
||||
sprintf (renamebuf, "%s.d00", argv[1]);
|
||||
snprintf(renamebuf, sizeof(renamebuf), "%s.d00", argv[1]);
|
||||
db_oflag = O_RDONLY; /* db files may be read-only */
|
||||
d_open (argv[1], "o");
|
||||
if (db_status != S_OKAY) {
|
||||
|
|
|
@ -795,7 +795,7 @@ void process_profile ()
|
|||
bad_profile = TRUE;
|
||||
continue;
|
||||
}
|
||||
strcpy (field_current->text, tok);
|
||||
snprintf(field_current->text, sizeof(field_current->text), "%s", tok);
|
||||
field_current->text_length = strlen (field_current->text);
|
||||
|
||||
/*-- get offset --*/
|
||||
|
|
|
@ -387,11 +387,11 @@ static char *char_label (int x)
|
|||
if (x > 256)
|
||||
return "";
|
||||
else if (x < 32) {
|
||||
sprintf (buf, "'CTRL-%c'", 0x40 | x);
|
||||
snprintf(buf, sizeof(buf), "'CTRL-%c'", 0x40 | x);
|
||||
return buf;
|
||||
}
|
||||
else if (x >= 128) {
|
||||
strcpy (buf, catgets(dtsearch_catd, MS_huff, 32,
|
||||
snprintf(buf, sizeof(buf), "%s", catgets(dtsearch_catd, MS_huff, 32,
|
||||
"(nonascii char, high bit set)"));
|
||||
return buf;
|
||||
}
|
||||
|
|
|
@ -247,7 +247,7 @@ static int parse_infbuf (char *infbuf)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
strcpy (parsed_dbname, ptr);
|
||||
snprintf(parsed_dbname, sizeof(parsed_dbname), "%s", ptr);
|
||||
parsed_dblk = usrblk.dblk;
|
||||
|
||||
/* Hop over to beginning of 2nd token */
|
||||
|
|
Loading…
Reference in a new issue