syslinux/com32/lib/strerror.c
<<
>>
Prefs
   1/*
   2 * strerror.c
   3 */
   4
   5#include <string.h>
   6
   7char *strerror(int errnum)
   8{
   9    static char message[32] = "error "; /* enough for error 2^63-1 */
  10
  11    char numbuf[32];
  12    char *p;
  13
  14    p = numbuf + sizeof numbuf;
  15    *--p = '\0';
  16
  17    do {
  18        *--p = (errnum % 10) + '0';
  19        errnum /= 10;
  20    } while (errnum);
  21
  22    return (char *)memcpy(message + 6, p, (numbuf + sizeof numbuf) - p);
  23}
  24
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.