]> mj.ucw.cz Git - libucw.git/blobdiff - lib/kmp.h
Conversion between charsets with allocation on the stack
[libucw.git] / lib / kmp.h
index abbf3b2312397bebcbd9aa1ef3ed81f0b0f18c8a..0a83dd7b3c4756320cae01c2fb45d9cb04ea6fe5 100644 (file)
--- a/lib/kmp.h
+++ b/lib/kmp.h
@@ -19,6 +19,8 @@
 
 #include "lib/lists.h"
 
+#include <string.h>
+
 /*
  * Input conversion flags (the conversion is handled exclusively by the KMP_GET_CHAR
  * macro, so you can define your own conversion modes, soo).
@@ -111,7 +113,7 @@ kmp_enter_string(struct kmp *kmp, const byte *str, uns id)
         * and uses KMP_GET_RAW to read its input.
         */
        byte buf[3*strlen(str)+1], *str2 = buf;
-       kmp_char_t c;
+       kmp_char_t c = 0;
        do
        {
                kmp_get_char(&str, &c, kmp->modify_flags);