eina_test_str: Make sure we have an empty string before using strcat
authorDaniel Willmann <daniel@totalueberwachung.de>
Wed, 12 Jun 2013 22:57:42 +0000 (23:57 +0100)
committerDaniel Willmann <daniel@totalueberwachung.de>
Wed, 12 Jun 2013 22:57:42 +0000 (23:57 +0100)
Caused issues with address sanitizer. Just calling allocating memory for
a string does not mean that it's empty/NULL-terminated.

src/tests/eina/eina_test_str.c

index b4c3660..1d95f21 100644 (file)
@@ -166,6 +166,7 @@ START_TEST(str_split)
         free(result);
 
    str = malloc(sizeof(char) * 1024);
+   str[0] = 0;
    for (elements = 0; elements < 300; elements++)
      strcat(str, "ma:");
    strcat(str, "ma");