get rid of ulton() - a joke

saves 32 bss, but adds 84 text oO
This commit is contained in:
tg
2006-11-09 23:55:52 +00:00
parent 88bf6422d9
commit 320f503391
4 changed files with 16 additions and 30 deletions

19
misc.c
View File

@@ -3,7 +3,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.21 2006/11/09 23:39:16 tg Exp $\t"
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.22 2006/11/09 23:55:51 tg Exp $\t"
MKSH_SH_H_ID);
unsigned char chtypes[UCHAR_MAX + 1]; /* type bits for unsigned char */
@@ -49,23 +49,6 @@ initctypes(void)
setctypes(" \n\t\"#$&'()*;<>?[]\\`|", C_QUOTE);
}
/* convert unsigned long to base N string */
char *
ulton(long unsigned int n, int base)
{
char *p;
static char buf[20];
p = &buf[sizeof (buf)];
*--p = '\0';
do {
*--p = "0123456789ABCDEF"[n%base];
n /= base;
} while (n != 0);
return p;
}
/* Allocate a string of size n+1 and copy upto n characters from the possibly
* null terminated string s into it. Always returns a null terminated string
* (unless n < 0).