summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2013-03-29 23:54:55 +0100
committerDaniel Carl <danielcarl@gmx.de>2013-03-29 23:54:55 +0100
commitd0c836132b5ceb49769b720e221dde2f866eaf36 (patch)
tree8f2f2f0f0f5825dbd91470287a3ca39b3ffe0a57 /src/util.c
parent4f1203f089a39db3bbd211cbfe8cbcb7482b4acc (diff)
Moved variables to the top of function.
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util.c b/src/util.c
index d984791..ca09c9a 100644
--- a/src/util.c
+++ b/src/util.c
@@ -100,15 +100,15 @@ char **util_get_lines(const char *filename)
char *util_strcasestr(const char *haystack, const char *needle)
{
+ unsigned char c1, c2;
+ int i, j;
int nlen = strlen(needle);
int hlen = strlen(haystack) - nlen + 1;
- int i;
for (i = 0; i < hlen; i++) {
- int j;
for (j = 0; j < nlen; j++) {
- unsigned char c1 = haystack[i + j];
- unsigned char c2 = needle[j];
+ c1 = haystack[i + j];
+ c2 = needle[j];
if (toupper(c1) != toupper(c2)) {
goto next;
}