Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
[bpt/emacs.git] / src / doprnt.c
index 2d5b893..3ff2f70 100644 (file)
@@ -2,7 +2,7 @@
    Also takes args differently: pass one pointer to an array of strings
    in addition to the format string which is separate.
    Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005,
-                 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+                 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -48,8 +48,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    another macro.  */
 #include "character.h"
 
-static int doprnt1 ();
-
 /* Generate output from a format-spec FORMAT,
    terminated at position FORMAT_END.
    Output goes in BUFFER, which has room for BUFSIZE chars.
@@ -61,13 +59,7 @@ static int doprnt1 ();
    Integers are passed as C integers.  */
 
 int
-doprnt (buffer, bufsize, format, format_end, nargs, args)
-     char *buffer;
-     register int bufsize;
-     char *format;
-     char *format_end;
-     int nargs;
-     char **args;
+doprnt (char *buffer, register int bufsize, char *format, char *format_end, int nargs, char **args)
 {
   int cnt = 0;                 /* Number of arg to gobble next */
   register char *fmt = format; /* Pointer into format string */
@@ -126,9 +118,9 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
                  unsigned n = *fmt - '0';
                  while ('0' <= fmt[1] && fmt[1] <= '9')
                    {
-                     if (n * 10 / 10 != n
-                         || (n = n * 10 + (fmt[1] - '0')) < n)
+                     if (n * 10 + fmt[1] - '0' < n)
                        error ("Format width or precision too large");
+                     n = n * 10 + fmt[1] - '0';
                      *string++ = *++fmt;
                    }
 
@@ -237,12 +229,12 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
                  /* Truncate the string at character boundary.  */
                  tem = bufsize;
                  while (!CHAR_HEAD_P (string[tem - 1])) tem--;
-                 bcopy (string, bufptr, tem);
+                 memcpy (bufptr, string, tem);
                  /* We must calculate WIDTH again.  */
                  width = strwidth (bufptr, tem);
                }
              else
-               bcopy (string, bufptr, tem);
+               memcpy (bufptr, string, tem);
              bufptr += tem;
              bufsize -= tem;
              if (minlen < 0)