diff options
author | Gene Cumm <gene.cumm@gmail.com> | 2011-02-08 20:07:43 -0500 |
---|---|---|
committer | Gene Cumm <gene.cumm@gmail.com> | 2011-02-08 20:07:43 -0500 |
commit | 6d63144949d795320bb7f70a6156b46615864f5f (patch) | |
tree | 94d7800de7008818b57fb3b1a30b3dd048cb58fe /com32 | |
parent | e86bdcd32ceb8550d0b1e59b73fb0ee243f3edad (diff) | |
download | syslinux-6d63144949d795320bb7f70a6156b46615864f5f.tar.gz |
memdisk & libcom32: Fix minor errors in previous commit
Diffstat (limited to 'com32')
-rw-r--r-- | com32/lib/syslinux/load_linux.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c index df793625..3ac6e5d0 100644 --- a/com32/lib/syslinux/load_linux.c +++ b/com32/lib/syslinux/load_linux.c @@ -38,6 +38,7 @@ #include <inttypes.h> #include <string.h> #include <minmax.h> +#include <suffix_number.h> #include <syslinux/align.h> #include <syslinux/linux.h> #include <syslinux/bootrm.h> @@ -96,42 +97,6 @@ struct linux_header { #define LOAD_HIGH 0x01 #define CAN_USE_HEAP 0x80 -/* Get a value with a potential suffix (k/m/g/t/p/e) */ -static unsigned long long suffix_number(const char *str) -{ - char *ep; - unsigned long long v; - int shift; - - v = strtoull(str, &ep, 0); - switch (*ep | 0x20) { - case 'k': - shift = 10; - break; - case 'm': - shift = 20; - break; - case 'g': - shift = 30; - break; - case 't': - shift = 40; - break; - case 'p': - shift = 50; - break; - case 'e': - shift = 60; - break; - default: - shift = 0; - break; - } - v <<= shift; - - return v; -} - /* * Find the last instance of a particular command line argument * (which should include the final =; do not use for boolean arguments) |