dthelp: Resolve format-overflow issues

This commit is contained in:
Peter Howkins
2021-12-23 19:54:18 +00:00
committed by Jon Trulson
parent 793d8b9262
commit bd49a5c948
2 changed files with 4 additions and 4 deletions

View File

@@ -88,7 +88,7 @@ if ((m_argc > 2) && (strchr(m_argv[2], 'f') || strchr(m_argv[2], 'F')))
/* fills ``install'' with path to ourself */ /* fills ``install'' with path to ourself */
{ {
char *path, *cp; char *path, *cp;
char buf[200]; char buf[BUFSIZ];
char patbuf[BUFSIZ]; char patbuf[BUFSIZ];
int quit, none; int quit, none;
@@ -138,7 +138,7 @@ else
quit++; quit++;
else else
*cp = '\0'; *cp = '\0';
sprintf(buf, "%s/%s", path, m_argv[0]); snprintf(buf, sizeof(buf), "%s/%s", path, m_argv[0]);
if (access(buf, 1) == 0) if (access(buf, 1) == 0)
{ {

View File

@@ -89,7 +89,7 @@ if ((m_argc > 2) && (strchr(m_argv[2], 'f') || strchr(m_argv[2], 'F')))
/* fills ``install'' with path to ourself */ /* fills ``install'' with path to ourself */
{ {
char *path, *cp; char *path, *cp;
char buf[200]; char buf[BUFSIZ];
char patbuf[BUFSIZ]; char patbuf[BUFSIZ];
int quit, none; int quit, none;
@@ -139,7 +139,7 @@ else
quit++; quit++;
else else
*cp = '\0'; *cp = '\0';
sprintf(buf, "%s/%s", path, m_argv[0]); snprintf(buf, sizeof(buf), "%s/%s", path, m_argv[0]);
if (access(buf, 1) == 0) if (access(buf, 1) == 0)
{ {