]> git.mdlowis.com Git - projs/libcds.git/commitdiff
Implemented string compare
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 20 Aug 2014 20:43:46 +0000 (16:43 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 20 Aug 2014 20:43:46 +0000 (16:43 -0400)
source/string/str.c

index 0f4bdc83fa5def209dff0295eec420bd901d54af..1c82cbbbdcca0e767a09a8c87427228b5d35e2bc 100644 (file)
@@ -89,8 +89,6 @@ str_t* str_insert(str_t* p_str1, size_t index, str_t* p_str2)
     return p_newstr;
 }
 
-#include <stdio.h>
-
 str_t* str_erase(str_t* p_str, size_t start, size_t end)
 {
     str_t* p_newstr = NULL;
@@ -122,9 +120,7 @@ str_t* str_substr(str_t* p_str, size_t start, size_t end)
 
 int str_compare(str_t* p_str1, str_t* p_str2)
 {
-    (void)p_str1;
-    (void)p_str2;
-    return 0;
+    return strcmp(p_str1->data, p_str2->data);
 }
 
 size_t str_find(str_t* p_str1, str_t* p_str2)