From 6555866bd1f1024456075235d9ba434606a31297 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Wed, 8 Jul 2020 09:47:39 +0200 Subject: lib: lzo: drop unused compression code The code doesn't compile and went unused since being added 10 years ago. Remove it. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- lib/lzo/Kconfig | 4 - lib/lzo/Makefile | 3 - lib/lzo/lzo1x_compress.c | 279 ----------------------------------------------- 3 files changed, 286 deletions(-) delete mode 100644 lib/lzo/lzo1x_compress.c (limited to 'lib') diff --git a/lib/lzo/Kconfig b/lib/lzo/Kconfig index 9276b2128a..17b0083236 100644 --- a/lib/lzo/Kconfig +++ b/lib/lzo/Kconfig @@ -1,7 +1,3 @@ config LZO_DECOMPRESS bool "include lzo uncompression support" select UNCOMPRESS - -config LZO_COMPRESS - bool - diff --git a/lib/lzo/Makefile b/lib/lzo/Makefile index f2191f4a3d..0e576a1c10 100644 --- a/lib/lzo/Makefile +++ b/lib/lzo/Makefile @@ -1,4 +1 @@ - -obj-$(CONFIG_LZO_COMPRESS) += lzo1x_compress.o obj-$(CONFIG_LZO_DECOMPRESS) += lzo1x_decompress_safe.o - diff --git a/lib/lzo/lzo1x_compress.c b/lib/lzo/lzo1x_compress.c deleted file mode 100644 index 236eb21167..0000000000 --- a/lib/lzo/lzo1x_compress.c +++ /dev/null @@ -1,279 +0,0 @@ -/* - * LZO1X Compressor from LZO - * - * Copyright (C) 1996-2012 Markus F.X.J. Oberhumer - * - * The full LZO package can be found at: - * http://www.oberhumer.com/opensource/lzo/ - * - * Changed for Linux kernel use by: - * Nitin Gupta - * Richard Purdie - */ - -#include -#include -#include -#include -#include "lzodefs.h" - -static noinline size_t -lzo1x_1_do_compress(const unsigned char *in, size_t in_len, - unsigned char *out, size_t *out_len, - size_t ti, void *wrkmem) -{ - const unsigned char *ip; - unsigned char *op; - const unsigned char * const in_end = in + in_len; - const unsigned char * const ip_end = in + in_len - 20; - const unsigned char *ii; - lzo_dict_t * const dict = (lzo_dict_t *) wrkmem; - - op = out; - ip = in; - ii = ip; - ip += ti < 4 ? 4 - ti : 0; - - for (;;) { - const unsigned char *m_pos; - size_t t, m_len, m_off; - u32 dv; -literal: - ip += 1 + ((ip - ii) >> 5); -next: - if (unlikely(ip >= ip_end)) - break; - dv = get_unaligned_le32(ip); - t = ((dv * 0x1824429d) >> (32 - D_BITS)) & D_MASK; - m_pos = in + dict[t]; - dict[t] = (lzo_dict_t) (ip - in); - if (unlikely(dv != get_unaligned_le32(m_pos))) - goto literal; - - ii -= ti; - ti = 0; - t = ip - ii; - if (t != 0) { - if (t <= 3) { - op[-2] |= t; - COPY4(op, ii); - op += t; - } else if (t <= 16) { - *op++ = (t - 3); - COPY8(op, ii); - COPY8(op + 8, ii + 8); - op += t; - } else { - if (t <= 18) { - *op++ = (t - 3); - } else { - size_t tt = t - 18; - *op++ = 0; - while (unlikely(tt > 255)) { - tt -= 255; - *op++ = 0; - } - *op++ = tt; - } - do { - COPY8(op, ii); - COPY8(op + 8, ii + 8); - op += 16; - ii += 16; - t -= 16; - } while (t >= 16); - if (t > 0) do { - *op++ = *ii++; - } while (--t > 0); - } - } - - m_len = 4; - { -#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && defined(LZO_USE_CTZ64) - u64 v; - v = get_unaligned((const u64 *) (ip + m_len)) ^ - get_unaligned((const u64 *) (m_pos + m_len)); - if (unlikely(v == 0)) { - do { - m_len += 8; - v = get_unaligned((const u64 *) (ip + m_len)) ^ - get_unaligned((const u64 *) (m_pos + m_len)); - if (unlikely(ip + m_len >= ip_end)) - goto m_len_done; - } while (v == 0); - } -# if defined(__LITTLE_ENDIAN) - m_len += (unsigned) __builtin_ctzll(v) / 8; -# elif defined(__BIG_ENDIAN) - m_len += (unsigned) __builtin_clzll(v) / 8; -# else -# error "missing endian definition" -# endif -#elif defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && defined(LZO_USE_CTZ32) - u32 v; - v = get_unaligned((const u32 *) (ip + m_len)) ^ - get_unaligned((const u32 *) (m_pos + m_len)); - if (unlikely(v == 0)) { - do { - m_len += 4; - v = get_unaligned((const u32 *) (ip + m_len)) ^ - get_unaligned((const u32 *) (m_pos + m_len)); - if (v != 0) - break; - m_len += 4; - v = get_unaligned((const u32 *) (ip + m_len)) ^ - get_unaligned((const u32 *) (m_pos + m_len)); - if (unlikely(ip + m_len >= ip_end)) - goto m_len_done; - } while (v == 0); - } -# if defined(__LITTLE_ENDIAN) - m_len += (unsigned) __builtin_ctz(v) / 8; -# elif defined(__BIG_ENDIAN) - m_len += (unsigned) __builtin_clz(v) / 8; -# else -# error "missing endian definition" -# endif -#else - if (unlikely(ip[m_len] == m_pos[m_len])) { - do { - m_len += 1; - if (ip[m_len] != m_pos[m_len]) - break; - m_len += 1; - if (ip[m_len] != m_pos[m_len]) - break; - m_len += 1; - if (ip[m_len] != m_pos[m_len]) - break; - m_len += 1; - if (ip[m_len] != m_pos[m_len]) - break; - m_len += 1; - if (ip[m_len] != m_pos[m_len]) - break; - m_len += 1; - if (ip[m_len] != m_pos[m_len]) - break; - m_len += 1; - if (ip[m_len] != m_pos[m_len]) - break; - m_len += 1; - if (unlikely(ip + m_len >= ip_end)) - goto m_len_done; - } while (ip[m_len] == m_pos[m_len]); - } -#endif - } -m_len_done: - - m_off = ip - m_pos; - ip += m_len; - ii = ip; - if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET) { - m_off -= 1; - *op++ = (((m_len - 1) << 5) | ((m_off & 7) << 2)); - *op++ = (m_off >> 3); - } else if (m_off <= M3_MAX_OFFSET) { - m_off -= 1; - if (m_len <= M3_MAX_LEN) - *op++ = (M3_MARKER | (m_len - 2)); - else { - m_len -= M3_MAX_LEN; - *op++ = M3_MARKER | 0; - while (unlikely(m_len > 255)) { - m_len -= 255; - *op++ = 0; - } - *op++ = (m_len); - } - *op++ = (m_off << 2); - *op++ = (m_off >> 6); - } else { - m_off -= 0x4000; - if (m_len <= M4_MAX_LEN) - *op++ = (M4_MARKER | ((m_off >> 11) & 8) - | (m_len - 2)); - else { - m_len -= M4_MAX_LEN; - *op++ = (M4_MARKER | ((m_off >> 11) & 8)); - while (unlikely(m_len > 255)) { - m_len -= 255; - *op++ = 0; - } - *op++ = (m_len); - } - *op++ = (m_off << 2); - *op++ = (m_off >> 6); - } - goto next; - } - *out_len = op - out; - return in_end - (ii - ti); -} - -int lzo1x_1_compress(const unsigned char *in, size_t in_len, - unsigned char *out, size_t *out_len, - void *wrkmem) -{ - const unsigned char *ip = in; - unsigned char *op = out; - size_t l = in_len; - size_t t = 0; - - while (l > 20) { - size_t ll = l <= (M4_MAX_OFFSET + 1) ? l : (M4_MAX_OFFSET + 1); - uintptr_t ll_end = (uintptr_t) ip + ll; - if ((ll_end + ((t + ll) >> 5)) <= ll_end) - break; - BUILD_BUG_ON(D_SIZE * sizeof(lzo_dict_t) > LZO1X_1_MEM_COMPRESS); - memset(wrkmem, 0, D_SIZE * sizeof(lzo_dict_t)); - t = lzo1x_1_do_compress(ip, ll, op, out_len, t, wrkmem); - ip += ll; - op += *out_len; - l -= ll; - } - t += l; - - if (t > 0) { - const unsigned char *ii = in + in_len - t; - - if (op == out && t <= 238) { - *op++ = (17 + t); - } else if (t <= 3) { - op[-2] |= t; - } else if (t <= 18) { - *op++ = (t - 3); - } else { - size_t tt = t - 18; - *op++ = 0; - while (tt > 255) { - tt -= 255; - *op++ = 0; - } - *op++ = tt; - } - if (t >= 16) do { - COPY8(op, ii); - COPY8(op + 8, ii + 8); - op += 16; - ii += 16; - t -= 16; - } while (t >= 16); - if (t > 0) do { - *op++ = *ii++; - } while (--t > 0); - } - - *op++ = M4_MARKER | 1; - *op++ = 0; - *op++ = 0; - - *out_len = op - out; - return LZO_E_OK; -} -EXPORT_SYMBOL_GPL(lzo1x_1_compress); - -MODULE_LICENSE("GPL"); -MODULE_DESCRIPTION("LZO1X-1 Compressor"); -- cgit v1.2.3 From ddcd3d43c1132e5754fa91398dd2138a35660c43 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 14 Sep 2020 12:05:49 +0200 Subject: sandbox: support escaping commas in --image filenames Some tools like afl-fuzz generate file names containing commas. Allow escaping the commas in the file names, so they can be passed to barebox. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/sandbox/os/common.c | 10 ++++++---- include/linux/string.h | 1 + lib/string.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c index 9f26f8fa6e..437fe3ecdf 100644 --- a/arch/sandbox/os/common.c +++ b/arch/sandbox/os/common.c @@ -212,6 +212,8 @@ int linux_execve(const char * filename, char *const argv[], char *const envp[]) extern void start_barebox(void); extern void mem_malloc_init(void *start, void *end); +extern char * strsep_unescaped(char **s, const char *ct); + static int add_image(char *str, char *devname_template, int *devname_number) { struct hf_info *hf = malloc(sizeof(struct hf_info)); @@ -225,15 +227,15 @@ static int add_image(char *str, char *devname_template, int *devname_number) if (!hf) return -1; - filename = strtok(str, ","); - while ((opt = strtok(NULL, ","))) { + filename = strsep_unescaped(&str, ","); + while ((opt = strsep_unescaped(&str, ","))) { if (!strcmp(opt, "ro")) readonly = 1; } /* parses: "devname=filename" */ - devname = strtok(filename, "="); - filename = strtok(NULL, "="); + devname = strsep_unescaped(&filename, "="); + filename = strsep_unescaped(&filename, "="); if (!filename) { filename = devname; snprintf(tmp, sizeof(tmp), diff --git a/include/linux/string.h b/include/linux/string.h index fd42f5020a..763ef500e5 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -12,6 +12,7 @@ extern char * ___strtok; extern char * strpbrk(const char *,const char *); extern char * strtok(char *,const char *); extern char * strsep(char **,const char *); +extern char * strsep_unescaped(char **,const char *); extern __kernel_size_t strspn(const char *,const char *); diff --git a/lib/string.c b/lib/string.c index 7548fd3581..50f8e2f87c 100644 --- a/lib/string.c +++ b/lib/string.c @@ -455,6 +455,49 @@ char * strsep(char **s, const char *ct) #endif EXPORT_SYMBOL(strsep); +/** + * strsep_unescaped - Split a string into tokens, while ignoring escaped delimiters + * @s: The string to be searched + * @ct: The delimiter characters to search for + * + * strsep_unescaped() behaves like strsep unless it meets an escaped delimiter. + * In that case, it shifts the string back in memory to overwrite the escape's + * backslash then continues the search until an unescaped delimiter is found. + */ +char *strsep_unescaped(char **s, const char *ct) +{ + char *sbegin = *s, *hay; + const char *needle; + size_t shift = 0; + + if (sbegin == NULL) + return NULL; + + for (hay = sbegin; *hay != '\0'; ++hay) { + *hay = hay[shift]; + + if (*hay == '\\') { + *hay = hay[++shift]; + if (*hay != '\\') + continue; + } + + for (needle = ct; *needle != '\0'; ++needle) { + if (*hay == *needle) + goto match; + } + } + + *s = NULL; + return sbegin; + +match: + *hay = '\0'; + *s = &hay[shift + 1]; + + return sbegin; +} + #ifndef __HAVE_ARCH_STRSWAB /** * strswab - swap adjacent even and odd bytes in %NUL-terminated string -- cgit v1.2.3 From 5487aa192da08801c18d2e46560f0522be080e83 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 14 Sep 2020 12:05:50 +0200 Subject: readkey: fix buffer overflow handling longer escape sequences My terminal emulator uses "\e[5;5~" (six bytes) to represent a Ctrl+PageUp, this overflows the esc buffer, which is only 5 bytes long as both UBSan and ASAN report. We have a check that should've avoided it, but it has an off-by one, which corrupts memory on sizes >= 4. Fix it. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- lib/readkey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/readkey.c b/lib/readkey.c index fd72951046..c26e9d51ab 100644 --- a/lib/readkey.c +++ b/lib/readkey.c @@ -61,7 +61,7 @@ int read_key(void) esc[i] = getchar(); if (esc[i++] == '~') break; - if (i == ARRAY_SIZE(esc)) + if (i == ARRAY_SIZE(esc) - 1) return -1; } } -- cgit v1.2.3 From 67f77f924295bb68786a47e81b8e059328896c98 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 14 Sep 2020 12:05:53 +0200 Subject: common: ubsan: replace pr_err with printf The pr_print family of functions also writes to the barebox log buffer, which we don't require for printing UBSan errors, which is a debugging aid. This also improves UBSan coverage as now undefined behavior within pr_print may be reported as well. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- lib/ubsan.c | 88 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) (limited to 'lib') diff --git a/lib/ubsan.c b/lib/ubsan.c index 41a5731dda..085d470cf7 100644 --- a/lib/ubsan.c +++ b/lib/ubsan.c @@ -60,8 +60,8 @@ static bool was_reported(struct source_location *location) static void print_source_location(const char *prefix, struct source_location *loc) { - pr_err("%s %s:%d:%d\n", prefix, loc->file_name, - loc->line & LINE_MASK, loc->column & COLUMN_MASK); + printf("%s %s:%d:%d\n", prefix, loc->file_name, + loc->line & LINE_MASK, loc->column & COLUMN_MASK); } static bool suppress_report(struct source_location *loc) @@ -157,16 +157,16 @@ static void ubsan_prologue(struct source_location *location, { in_ubsan++; - pr_err("========================================" - "========================================\n"); + printf("========================================" + "========================================\n"); print_source_location("UBSAN: Undefined behaviour in", location); } static void ubsan_epilogue(unsigned long *flags) { dump_stack(); - pr_err("========================================" - "========================================\n"); + printf("========================================" + "========================================\n"); in_ubsan--; } @@ -186,13 +186,13 @@ static void handle_overflow(struct overflow_data *data, void *lhs, val_to_string(lhs_val_str, sizeof(lhs_val_str), type, lhs); val_to_string(rhs_val_str, sizeof(rhs_val_str), type, rhs); - pr_err("%s integer overflow:\n", - type_is_signed(type) ? "signed" : "unsigned"); - pr_err("%s %c %s cannot be represented in type %s\n", - lhs_val_str, - op, - rhs_val_str, - type->type_name); + printf("%s integer overflow:\n", + type_is_signed(type) ? "signed" : "unsigned"); + printf("%s %c %s cannot be represented in type %s\n", + lhs_val_str, + op, + rhs_val_str, + type->type_name); ubsan_epilogue(&flags); } @@ -232,8 +232,8 @@ void __ubsan_handle_negate_overflow(struct overflow_data *data, val_to_string(old_val_str, sizeof(old_val_str), data->type, old_val); - pr_err("negation of %s cannot be represented in type %s:\n", - old_val_str, data->type->type_name); + printf("negation of %s cannot be represented in type %s:\n", + old_val_str, data->type->type_name); ubsan_epilogue(&flags); } @@ -254,10 +254,10 @@ void __ubsan_handle_divrem_overflow(struct overflow_data *data, val_to_string(rhs_val_str, sizeof(rhs_val_str), data->type, rhs); if (type_is_signed(data->type) && get_signed_val(data->type, rhs) == -1) - pr_err("division of %s by -1 cannot be represented in type %s\n", - rhs_val_str, data->type->type_name); + printf("division of %s by -1 cannot be represented in type %s\n", + rhs_val_str, data->type->type_name); else - pr_err("division by zero\n"); + printf("division by zero\n"); ubsan_epilogue(&flags); } @@ -272,9 +272,9 @@ static void handle_null_ptr_deref(struct type_mismatch_data_common *data) ubsan_prologue(data->location, &flags); - pr_err("%s null pointer of type %s\n", - type_check_kinds[data->type_check_kind], - data->type->type_name); + printf("%s null pointer of type %s\n", + type_check_kinds[data->type_check_kind], + data->type->type_name); ubsan_epilogue(&flags); } @@ -289,10 +289,10 @@ static void handle_misaligned_access(struct type_mismatch_data_common *data, ubsan_prologue(data->location, &flags); - pr_err("%s misaligned address %p for type %s\n", - type_check_kinds[data->type_check_kind], - (void *)ptr, data->type->type_name); - pr_err("which requires %ld byte alignment\n", data->alignment); + printf("%s misaligned address %p for type %s\n", + type_check_kinds[data->type_check_kind], + (void *)ptr, data->type->type_name); + printf("which requires %ld byte alignment\n", data->alignment); ubsan_epilogue(&flags); } @@ -306,10 +306,10 @@ static void handle_object_size_mismatch(struct type_mismatch_data_common *data, return; ubsan_prologue(data->location, &flags); - pr_err("%s address %p with insufficient space\n", + printf("%s address %p with insufficient space\n", type_check_kinds[data->type_check_kind], (void *) ptr); - pr_err("for an object of type %s\n", data->type->type_name); + printf("for an object of type %s\n", data->type->type_name); ubsan_epilogue(&flags); } @@ -364,8 +364,8 @@ void __ubsan_handle_out_of_bounds(struct out_of_bounds_data *data, void *index) ubsan_prologue(&data->location, &flags); val_to_string(index_str, sizeof(index_str), data->index_type, index); - pr_err("index %s is out of range for type %s\n", index_str, - data->array_type->type_name); + printf("index %s is out of range for type %s\n", index_str, + data->array_type->type_name); ubsan_epilogue(&flags); } EXPORT_SYMBOL(__ubsan_handle_out_of_bounds); @@ -408,22 +408,22 @@ void __ubsan_handle_shift_out_of_bounds(struct shift_out_of_bounds_data *data, val_to_string(lhs_str, sizeof(lhs_str), lhs_type, lhs); if (val_is_negative(rhs_type, rhs)) - pr_err("shift exponent %s is negative\n", rhs_str); + printf("shift exponent %s is negative\n", rhs_str); else if (get_unsigned_val(rhs_type, rhs) >= - type_bit_width(lhs_type)) - pr_err("shift exponent %s is too large for %u-bit type %s\n", - rhs_str, - type_bit_width(lhs_type), - lhs_type->type_name); + type_bit_width(lhs_type)) + printf("shift exponent %s is too large for %u-bit type %s\n", + rhs_str, + type_bit_width(lhs_type), + lhs_type->type_name); else if (val_is_negative(lhs_type, lhs)) - pr_err("left shift of negative value %s\n", - lhs_str); + printf("left shift of negative value %s\n", + lhs_str); else - pr_err("left shift of %s by %s places cannot be" - " represented in type %s\n", - lhs_str, rhs_str, - lhs_type->type_name); + printf("left shift of %s by %s places cannot be" + " represented in type %s\n", + lhs_str, rhs_str, + lhs_type->type_name); ubsan_epilogue(&flags); } @@ -435,7 +435,7 @@ void __ubsan_handle_builtin_unreachable(struct unreachable_data *data) unsigned long flags; ubsan_prologue(&data->location, &flags); - pr_err("calling __builtin_unreachable()\n"); + printf("calling __builtin_unreachable()\n"); ubsan_epilogue(&flags); panic("can't return from __builtin_unreachable()"); } @@ -454,8 +454,8 @@ void __ubsan_handle_load_invalid_value(struct invalid_value_data *data, val_to_string(val_str, sizeof(val_str), data->type, val); - pr_err("load of value %s is not a valid value for type %s\n", - val_str, data->type->type_name); + printf("load of value %s is not a valid value for type %s\n", + val_str, data->type->type_name); ubsan_epilogue(&flags); } -- cgit v1.2.3 From 74d78a1e4a47c322d348823b2836614b531cda8b Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 14 Sep 2020 15:37:44 +0200 Subject: lib: string: retire deprecated strtok() in favor of reentrant strsep() With the recent changes to ARCH=sandbox, there are no remaining in-tree users for strtok() anymore. Out-of-tree users are better served by using the reentrant strsep(), which has existed in-tree for as long. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- include/linux/string.h | 2 -- lib/string.c | 35 +++-------------------------------- 2 files changed, 3 insertions(+), 34 deletions(-) (limited to 'lib') diff --git a/include/linux/string.h b/include/linux/string.h index 763ef500e5..2b699957e8 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -8,9 +8,7 @@ extern "C" { #endif -extern char * ___strtok; extern char * strpbrk(const char *,const char *); -extern char * strtok(char *,const char *); extern char * strsep(char **,const char *); extern char * strsep_unescaped(char **,const char *); extern __kernel_size_t strspn(const char *,const char *); diff --git a/lib/string.c b/lib/string.c index 50f8e2f87c..733b567300 100644 --- a/lib/string.c +++ b/lib/string.c @@ -13,6 +13,9 @@ * * Fri Jun 25 1999, Ingo Oeser * - Added strsep() which will replace strtok() soon (because strsep() is * reentrant and should be faster). Use only strsep() in new code, please. + * * Mon Sep 14 2020, Ahmad Fatoum + * - Kissed strtok() goodbye + * */ #include @@ -20,8 +23,6 @@ #include #include -char * ___strtok; - #ifndef __HAVE_ARCH_STRNICMP /** * strnicmp - Case insensitive, length-limited string comparison @@ -396,36 +397,6 @@ char * strpbrk(const char * cs,const char * ct) #endif EXPORT_SYMBOL(strpbrk); -#ifndef __HAVE_ARCH_STRTOK -/** - * strtok - Split a string into tokens - * @s: The string to be searched - * @ct: The characters to search for - * - * WARNING: strtok is deprecated, use strsep instead. - */ -char * strtok(char * s, const char * ct) -{ - char *sbegin, *send; - - sbegin = s ? s : ___strtok; - if (!sbegin) { - return NULL; - } - sbegin += strspn(sbegin,ct); - if (*sbegin == '\0') { - ___strtok = NULL; - return( NULL ); - } - send = strpbrk( sbegin, ct); - if (send && *send != '\0') - *send++ = '\0'; - ___strtok = send; - return (sbegin); -} -#endif -EXPORT_SYMBOL(strtok); - #ifndef __HAVE_ARCH_STRSEP /** * strsep - Split a string into tokens -- cgit v1.2.3