summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-01-15 19:23:44 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-01-15 19:23:44 +0000
commitee6cc91a03ae264f700bedfbf5c1d20532abc3a1 (patch)
tree4f9f0c4ba76975dcceb7efcbf678693df366c4ca /src/lib
parenteb72593bbca59541dacf706ceb6d6f0fa29756f4 (diff)
eina - fix eina_strndup test passing
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/efreet/efreet_cache.c2
-rw-r--r--src/lib/eina/eina_inline_str.x14
2 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/efreet/efreet_cache.c b/src/lib/efreet/efreet_cache.c
index 883cf5e3c2..329bcc7ebc 100644
--- a/src/lib/efreet/efreet_cache.c
+++ b/src/lib/efreet/efreet_cache.c
@@ -117,7 +117,7 @@ _ipc_launch(void)
117 char buf[PATH_MAX]; 117 char buf[PATH_MAX];
118 int num; 118 int num;
119 int try_gap = 10000; // 10ms 119 int try_gap = 10000; // 10ms
120 int tries = 200; // 200 * 10ms == 2sec 120 int tries = 1000; // 1000 * 10ms == 10sec
121 const char *s; 121 const char *s;
122 122
123 s = getenv("EFREETD_CONNECT_TRIES"); 123 s = getenv("EFREETD_CONNECT_TRIES");
diff --git a/src/lib/eina/eina_inline_str.x b/src/lib/eina/eina_inline_str.x
index 1ca5093ba2..96de70336a 100644
--- a/src/lib/eina/eina_inline_str.x
+++ b/src/lib/eina/eina_inline_str.x
@@ -96,13 +96,19 @@ eina_strndup(const char *str, size_t n)
96{ 96{
97 char *ret; 97 char *ret;
98 const char *p; 98 const char *p;
99 size_t slen; 99 size_t slen = 0;
100 100
101 if (!str) 101 if (!str)
102 return NULL; 102 return NULL;
103 103 for (p = str; *p; p++)
104 for (p = str; (*p) && ((size_t)(p - str) < n); p++) 104 {
105 slen = (size_t)(p - str); 105 slen = (size_t)(p - str) + 1;
106 if (slen > n)
107 {
108 slen = n;
109 break;
110 }
111 }
106 ret = (char *)malloc(slen + 1); /* cast for C++ code */ 112 ret = (char *)malloc(slen + 1); /* cast for C++ code */
107 if (!ret) 113 if (!ret)
108 return NULL; 114 return NULL;