SDB: change strnlen -> s_strnlen 21/13821/1
authorho.namkoong <ho.namkoong@samsung.com>
Tue, 17 Dec 2013 04:09:35 +0000 (13:09 +0900)
committerho.namkoong <ho.namkoong@samsung.com>
Tue, 17 Dec 2013 04:09:35 +0000 (13:09 +0900)
Mingw does not have strnlen

Change-Id: I686df6a00fe0bf8d0e41cfc902b2a43633468ed8
Signed-off-by: ho.namkoong <ho.namkoong@samsung.com>
src/listener.c [changed mode: 0644->0755]
src/strutils.c

old mode 100644 (file)
new mode 100755 (executable)
index 0ab08b5..2ade2cc
@@ -27,6 +27,7 @@
 #include <stddef.h>
 #include <string.h>
 #include <stdlib.h>
+#include <stdio.h>
 
 #include "log.h"
 #include "listener.h"
index 062f9596acc93fe8da1c501b8b2111a975ae1e8c..987851ae57665ee23e1f702c12b24ce3759b4687 100755 (executable)
@@ -119,7 +119,7 @@ char* strlchr(const char*s, int chr) {
     if(s == NULL) {
         return NULL;
     }
-    int len = strnlen(s, PATH_MAX);
+    int len = s_strnlen(s, PATH_MAX);
     int i = len - 1;
     for(; i>-1; i--) {
         if(s[i] == chr) {
@@ -138,7 +138,7 @@ char* trim(char *s) {
 
 void rtrim(char* s) {
 
-    int len = strnlen(s, PATH_MAX) - 1;
+    int len = s_strnlen(s, PATH_MAX) - 1;
     char* t = s + len;
 
     for(; len > -1; len--) {