diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-08-28 22:00:09 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-08-28 22:00:09 +0000 |
commit | 1a1d77dd589de5a567fa95e36aa6999c704ceca4 (patch) | |
tree | 141e31f89f18b9fe0831f31852e0435ceaccafc5 /lib | |
parent | fb9c690a18b3d66925a65b17441c37fa14d4370b (diff) |
Merge with 2.4.0-test7.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cmdline.c | 15 | ||||
-rw-r--r-- | lib/string.c | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/lib/cmdline.c b/lib/cmdline.c index e147bc0b1..653287396 100644 --- a/lib/cmdline.c +++ b/lib/cmdline.c @@ -85,12 +85,12 @@ char *get_options (char *str, int nints, int *ints) * @ptr: Where parse begins * @retptr: (output) Pointer to next char after parse completes * - * Parses a string into a number. The number stored - * at @ptr is potentially suffixed with %K (for - * kilobytes, or 1024 bytes) or suffixed with %M (for - * megabytes, or 1048576 bytes). If the number is suffixed - * with K or M, then the return value is the number - * multiplied by one kilobyte, or one megabyte, respectively. + * Parses a string into a number. The number stored at @ptr is + * potentially suffixed with %K (for kilobytes, or 1024 bytes), + * %M (for megabytes, or 1048576 bytes), or %G (for gigabytes, or + * 1073741824). If the number is suffixed with K, M, or G, then + * the return value is the number multiplied by one kilobyte, one + * megabyte, or one gigabyte, respectively. */ unsigned long memparse (char *ptr, char **retptr) @@ -98,6 +98,9 @@ unsigned long memparse (char *ptr, char **retptr) unsigned long ret = simple_strtoul (ptr, retptr, 0); switch (**retptr) { + case 'G': + case 'g': + ret <<= 10; case 'M': case 'm': ret <<= 10; diff --git a/lib/string.c b/lib/string.c index 81b531cda..a748d41b4 100644 --- a/lib/string.c +++ b/lib/string.c @@ -250,7 +250,7 @@ char * strsep(char **s, const char * ct) *s = strpbrk( sbegin, ct); if (*s && **s != '\0') - **s++ = '\0'; + *(*s)++ = '\0'; return (sbegin); } #endif |