[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/kdeprint/cups
From:       Lubos Lunak <l.lunak () kde ! org>
Date:       2002-12-12 18:13:55
[Download RAW message or body]

CVS commit by lunakl: 

strncpy -> strlcpy


  M +8 -6      cupsdoprint.c   1.6


--- kdelibs/kdeprint/cups/cupsdoprint.c  #1.5:1.6
@@ -18,4 +18,6 @@
  **/
 
+#include <config.h>
+
 #include <unistd.h>
 #include <string.h>
@@ -143,13 +145,13 @@ int main(int argc, char* argv[])
                 {
                         case 'P':
-                                strncpy(printer, optarg, BUFSIZE);
+                                strlcpy(printer, optarg, BUFSIZE);
                                 if ((a=strchr(printer, '/')) != NULL)
                                         error("This utility doesn't support printer instances");
                                 break;
                         case 'J':
-                                strncpy(jobname, optarg, BUFSIZE);
+                                strlcpy(jobname, optarg, BUFSIZE);
                                 break;
                         case 'H':
-                                strncpy(host, optarg, BUFSIZE);
+                                strlcpy(host, optarg, BUFSIZE);
                                 if ((a=strchr(host, ':')) != NULL)
                                 {
@@ -161,9 +163,9 @@ int main(int argc, char* argv[])
                                 break;
                         case 'U':
-                                strncpy(login, optarg, BUFSIZE2);
+                                strlcpy(login, optarg, BUFSIZE2);
                                 if ((a=strchr(login, ':')) != NULL)
                                 {
                                         *a = 0;
-                                        strncpy(passwd, ++a, BUFSIZE2);
+                                        strlcpy(passwd, ++a, BUFSIZE2);
                                 }
                                 break;
@@ -189,5 +191,5 @@ int main(int argc, char* argv[])
                 printer[BUFSIZE-1] = '\0';
                 if (getenv("PRINTER") != NULL)
-                        strncpy(printer, getenv("PRINTER"), BUFSIZE-1);
+                        strlcpy(printer, getenv("PRINTER"), BUFSIZE-1);
                 else
                         error("No printer specified (and PRINTER variable is empty)");


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic