]> granicus.if.org Git - php/commitdiff
MFH
authorAntony Dovgal <tony2001@php.net>
Thu, 28 Dec 2006 20:45:36 +0000 (20:45 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 28 Dec 2006 20:45:36 +0000 (20:45 +0000)
ext/fdf/fdf.c
ext/mime_magic/mime_magic.c

index c323e6b4a0d4ac547128e0218f680494a9e6b774..215f411f84327cfa5d55af93e4cae79fd45b808c 100644 (file)
@@ -1492,8 +1492,7 @@ PHP_FUNCTION(fdf_get_attachment) {
                RETURN_FALSE;
        }
 
-       strncpy(pathbuf , savepath, MAXPATHLEN-1);
-       pathbuf[MAXPATHLEN-1] = '\0';
+       strlcpy(pathbuf, savepath, sizeof(pathbuf));
 
        if(0 == stat(pathbuf, &statBuf)) {
                is_dir = S_ISDIR(statBuf.st_mode);
index df2d9c3304bf7265134960104762aa132eeffe87..0e2b0e0606acab13603db2be1e1d97f2be94061d 100644 (file)
@@ -651,9 +651,7 @@ static int parse(char *l, int lineno)
     }
     else
                m->nospflag = 0;
-    strncpy(m->desc, l, sizeof(m->desc) - 1);
-    m->desc[sizeof(m->desc) - 1] = '\0';
-
+    strlcpy(m->desc, l, sizeof(m->desc));
     return 0;
 }