diff options
author | Steve Peters <steve@fisharerojo.org> | 2006-07-10 17:23:02 +0000 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2006-07-10 17:23:02 +0000 |
commit | 6fca0082ec4f3b34a0dabc78331bad8c22489dd2 (patch) | |
tree | 5b5f73a8bc38c7378f649cb017829d8c6a07563c /util.c | |
parent | 5b38b9cdaffc29c5d28feb5763086264c6c2360a (diff) | |
download | perl-6fca0082ec4f3b34a0dabc78331bad8c22489dd2.tar.gz |
Convert some low hanging fruit to my_strlcpy/my_strlcat.
p4raw-id: //depot/perl@28533
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -3022,7 +3022,7 @@ Perl_find_script(pTHX_ const char *scriptname, bool dosearch, if ((strlen(tmpbuf) + strlen(scriptname) + MAX_EXT_LEN) >= sizeof tmpbuf) continue; /* don't search dir with too-long name */ - strcat(tmpbuf, scriptname); + my_strlcat(tmpbuf, scriptname, sizeof(tmpbuf)); #else /* !VMS */ #ifdef DOSISH @@ -3054,11 +3054,10 @@ Perl_find_script(pTHX_ const char *scriptname, bool dosearch, len = strlen(scriptname); if (len+MAX_EXT_LEN+1 >= sizeof(tmpbuf)) break; - /* FIXME? Convert to memcpy */ - cur = strcpy(tmpbuf, scriptname); + cur = my_strlcpy(tmpbuf, scriptname, sizeof(tmpbuf)); } } while (extidx >= 0 && ext[extidx] /* try an extension? */ - && strcpy(tmpbuf+len, ext[extidx++])); + && my_strlcpy(tmpbuf+len, ext[extidx++], sizeof(tmpbuf) - len)); #endif } #endif @@ -3135,7 +3134,7 @@ Perl_find_script(pTHX_ const char *scriptname, bool dosearch, #ifdef SEARCH_EXTS } while ( retval < 0 /* not there */ && extidx>=0 && ext[extidx] /* try an extension? */ - && strcpy(tmpbuf+len, ext[extidx++]) + && my_strlcpy(tmpbuf+len, ext[extidx++], sizeof(tmpbuf) - len) ); #endif if (retval < 0) |