diff options
Diffstat (limited to 'apps/plugins/lua/strncat.c')
-rw-r--r-- | apps/plugins/lua/strncat.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/apps/plugins/lua/strncat.c b/apps/plugins/lua/strncat.c index 5b15ff07b1..147397440a 100644 --- a/apps/plugins/lua/strncat.c +++ b/apps/plugins/lua/strncat.c | |||
@@ -8,11 +8,27 @@ char *strncat(char *s, const char *t, size_t n) { | |||
8 | s+=strlen(s); | 8 | s+=strlen(s); |
9 | if (__unlikely((max=s+n)==s)) goto fini; | 9 | if (__unlikely((max=s+n)==s)) goto fini; |
10 | for (;;) { | 10 | for (;;) { |
11 | if (__unlikely(!(*s = *t))) break; if (__unlikely(++s==max)) break; ++t; | 11 | if (__unlikely(!(*s = *t))) |
12 | break; | ||
13 | if (__unlikely(++s==max)) | ||
14 | break; | ||
15 | ++t; | ||
12 | #ifndef WANT_SMALL_STRING_ROUTINES | 16 | #ifndef WANT_SMALL_STRING_ROUTINES |
13 | if (__unlikely(!(*s = *t))) break; if (__unlikely(++s==max)) break; ++t; | 17 | if (__unlikely(!(*s = *t))) |
14 | if (__unlikely(!(*s = *t))) break; if (__unlikely(++s==max)) break; ++t; | 18 | break; |
15 | if (__unlikely(!(*s = *t))) break; if (__unlikely(++s==max)) break; ++t; | 19 | if (__unlikely(++s==max)) |
20 | break; | ||
21 | ++t; | ||
22 | if (__unlikely(!(*s = *t))) | ||
23 | break; | ||
24 | if (__unlikely(++s==max)) | ||
25 | break; | ||
26 | ++t; | ||
27 | if (__unlikely(!(*s = *t))) | ||
28 | break; | ||
29 | if (__unlikely(++s==max)) | ||
30 | break; | ||
31 | ++t; | ||
16 | #endif | 32 | #endif |
17 | } | 33 | } |
18 | *s=0; | 34 | *s=0; |