Changed calls to strncat() to safe_strcat(). Fix from SAMBA_2_0 branch.
authorTim Potter <tpot@samba.org>
Wed, 7 Apr 1999 04:20:00 +0000 (04:20 +0000)
committerTim Potter <tpot@samba.org>
Wed, 7 Apr 1999 04:20:00 +0000 (04:20 +0000)
(This used to be commit 2d2c5ae7cd610b0d97151f90ad5ac7f4e41e514d)

source3/printing/printing.c

index c38808ab7e74a73e9812df59f4b5b08bf01899f8..dc28f176159450047e6caa6c82758227c5638702 100644 (file)
@@ -263,8 +263,8 @@ static BOOL parse_lpq_bsd(char *line,print_queue_struct *buf,BOOL first)
     bufsize = sizeof(buf->file) - strlen(buf->file) - 1;
 
     for (i = (FILETOK + 1); i < TOTALTOK; i++) {
-      strncat(buf->file," ",bufsize);
-      strncat(buf->file,tok[i],bufsize - 1);
+      safe_strcat(buf->file," ",bufsize);
+      safe_strcat(buf->file,tok[i],bufsize - 1);
       bufsize = sizeof(buf->file) - strlen(buf->file) - 1;
       if (bufsize <= 0) {
         break;
@@ -378,8 +378,8 @@ static BOOL parse_lpq_lprng(char *line,print_queue_struct *buf,BOOL first)
     bufsize = sizeof(buf->file) - strlen(buf->file) - 1;
 
     for (i = (LPRNG_FILETOK + 1); i < LPRNG_TOTALTOK; i++) {
-      strncat(buf->file," ",bufsize);
-      strncat(buf->file,tokarr[i],bufsize - 1);
+      safe_strcat(buf->file," ",bufsize);
+      safe_strcat(buf->file,tokarr[i],bufsize - 1);
       bufsize = sizeof(buf->file) - strlen(buf->file) - 1;
       if (bufsize <= 0) {
         break;