X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/60a917ef0909a3d22904e8204a0df64094af6e50:/grubload/minilib.c..31be35cda26f033fe62db673a8a973f0b15c9de7:/lib/minilib.c?ds=inline diff --git a/grubload/minilib.c b/lib/minilib.c similarity index 79% rename from grubload/minilib.c rename to lib/minilib.c index b9813d7..f64f3b1 100644 --- a/grubload/minilib.c +++ b/lib/minilib.c @@ -46,18 +46,35 @@ int strlen(char *c) return l; } +void strcpy(unsigned char *a2, unsigned char *a1) +{ + do { + *(a2++) = *a1; + } while (*(a1++)); +} + void puts(char *c) { putbytes(c, strlen(c)); } static char hexarr[] = "0123456789ABCDEF"; -void puthex(unsigned long l) +void tohex(unsigned char *s, unsigned long l) { int i; for (i = 0; i < 8; i++) { - putbyte(hexarr[l >> 28]); + s[i] = hexarr[l >> 28]; l <<= 4; } } + +void puthex(unsigned long l) +{ + unsigned char d[9]; + d[8] = 0; + tohex(d, l); + puts(d); +} + +