aboutsummaryrefslogtreecommitdiffstats
path: root/src/string/substring.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-09-02 04:44:53 +0200
committerMattias Andrée <maandree@operamail.com>2015-09-02 04:44:53 +0200
commitbd5d2162efae9913f2666c80bdf944a65ea95590 (patch)
tree7cfda8110528b22a8377bf9fdf526b9e203beda9 /src/string/substring.h
parentremove old debug line (diff)
downloadslibc-bd5d2162efae9913f2666c80bdf944a65ea95590.tar.gz
slibc-bd5d2162efae9913f2666c80bdf944a65ea95590.tar.bz2
slibc-bd5d2162efae9913f2666c80bdf944a65ea95590.tar.xz
fix more errors
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/string/substring.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/string/substring.h b/src/string/substring.h
index 10e4a7d..9d6dbfe 100644
--- a/src/string/substring.h
+++ b/src/string/substring.h
@@ -47,7 +47,7 @@
ssize_t hay, ned, skp;
ned = 0, skp = next_map[0] = -1;
- while (ned < needle_length)
+ while (ned < (ssize_t)needle_length)
{
while ((skp > -1) && !CHREQ(needle[ned], needle[skp]))
skp = next_map[skp];
@@ -56,15 +56,18 @@
}
hay = ned = 0;
- while (hay < haystack_length)
+ while (hay < (ssize_t)haystack_length)
{
while ((ned > -1) && !CHREQ(haystack[hay], needle[ned]))
ned = next_map[ned];
hay++, ned++;
- if (ned >= needle_length)
+ if (ned >= (ssize_t)needle_length)
return needle + (hay - ned);
}
return NULL;
}
+
+#undef CHREQ
+