]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Switch from strncpy to memcpy in a few places.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 31 Jan 2013 13:08:59 +0000 (13:08 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 31 Jan 2013 13:08:59 +0000 (13:08 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10845 7a7537e8-13f0-0310-91df-b6672ffda945

cups/snprintf.c
ppdc/ppdc-source.cxx

index 2c45fa8df1132968dee24fb85d18e2875af9d8bf..9af6b90f8544640f36e658015bbd6ee1e24afe87 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   snprintf functions for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -296,13 +296,13 @@ _cups_vsnprintf(char       *buffer,       /* O - Output buffer */
 
              if (sign == '-')
              {
-               strncpy(bufptr, s, (size_t)slen);
+               memcpy(bufptr, s, (size_t)slen);
                memset(bufptr + slen, ' ', (size_t)(width - slen));
              }
              else
              {
                memset(bufptr, ' ', (size_t)(width - slen));
-               strncpy(bufptr + width - slen, s, (size_t)slen);
+               memcpy(bufptr + width - slen, s, (size_t)slen);
              }
 
              bufptr += width;
index 9560daa49bb7c58df45be365059bae6e4451907d..222ccfd25f69f6a315274e26a95e07318a975c01 100644 (file)
@@ -3,7 +3,7 @@
 //
 //   Source class for the CUPS PPD Compiler.
 //
-//   Copyright 2007-2012 by Apple Inc.
+//   Copyright 2007-2013 by Apple Inc.
 //   Copyright 2002-2007 by Easy Software Products.
 //
 //   These coded instructions, statements, and computer programs are the
@@ -2292,7 +2292,7 @@ ppdcSource::quotef(cups_file_t *fp,       // I - File to write to
            if ((format - bufformat + 1) > (int)sizeof(tformat))
              break;
 
-           strncpy(tformat, bufformat, format - bufformat);
+           memcpy(tformat, bufformat, format - bufformat);
            tformat[format - bufformat] = '\0';
 
            bytes += cupsFilePrintf(fp, tformat, va_arg(ap, double));
@@ -2309,7 +2309,7 @@ ppdcSource::quotef(cups_file_t *fp,       // I - File to write to
            if ((format - bufformat + 1) > (int)sizeof(tformat))
              break;
 
-           strncpy(tformat, bufformat, format - bufformat);
+           memcpy(tformat, bufformat, format - bufformat);
            tformat[format - bufformat] = '\0';
 
 #  ifdef HAVE_LONG_LONG
@@ -2327,7 +2327,7 @@ ppdcSource::quotef(cups_file_t *fp,       // I - File to write to
            if ((format - bufformat + 1) > (int)sizeof(tformat))
              break;
 
-           strncpy(tformat, bufformat, format - bufformat);
+           memcpy(tformat, bufformat, format - bufformat);
            tformat[format - bufformat] = '\0';
 
            bytes += cupsFilePrintf(fp, tformat, va_arg(ap, void *));