fix printf warning
[oweals/busybox.git] / libbb / xfuncs.c
index 43e8aef0c7c15239e4c6e1ec34f32e2274a20b3b..01b2f87bcd2504e538db3b3fd502a3ecd7f62cdd 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Utility routines.
  *
- * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -59,6 +59,7 @@ extern void *xcalloc(size_t nmemb, size_t size)
        return ptr;
 }
 #endif
+#endif /* DMALLOC */
 
 #ifdef L_xstrdup
 extern char * bb_xstrdup (const char *s) {
@@ -75,7 +76,6 @@ extern char * bb_xstrdup (const char *s) {
        return t;
 }
 #endif
-#endif /* DMALLOC */
 
 #ifdef L_xstrndup
 extern char * bb_xstrndup (const char *s, int n) {
@@ -85,7 +85,7 @@ extern char * bb_xstrndup (const char *s, int n) {
                bb_error_msg_and_die("bb_xstrndup bug");
 
        t = xmalloc(++n);
-       
+
        return safe_strncpy(t,s,n);
 }
 #endif
@@ -104,7 +104,7 @@ FILE *bb_xfopen(const char *path, const char *mode)
 extern int bb_xopen(const char *pathname, int flags)
 {
        int ret;
-       
+
        ret = open(pathname, flags, 0777);
        if (ret == -1) {
                bb_perror_msg_and_die("%s", pathname);
@@ -136,6 +136,7 @@ extern void bb_xread_all(int fd, void *buf, size_t count)
                        bb_error_msg_and_die("Short read");
                }
                count -= size;
+               buf = ((char *) buf) + size;
        }
        return;
 }
@@ -145,10 +146,10 @@ extern void bb_xread_all(int fd, void *buf, size_t count)
 extern unsigned char bb_xread_char(int fd)
 {
        char tmp;
-       
+
        bb_xread_all(fd, &tmp, 1);
 
-       return(tmp);    
+       return(tmp);
 }
 #endif