aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid M. Syzdek <david@syzdek.net>2022-03-09 14:01:02 -0900
committerDavid M. Syzdek <david@syzdek.net>2022-03-09 14:01:02 -0900
commit643d352eb2008a4d8d09b143c684e4be7a22da26 (patch)
treedfb3067fc9983e2842cbf0eeb9936a12a643977f
parent1e44738f716a3b9d0d7858fbf058f7712ea8694b (diff)
downloadtinyrad-643d352eb2008a4d8d09b143c684e4be7a22da26.tar.gz
tinyrad-643d352eb2008a4d8d09b143c684e4be7a22da26.tar.bz2
tinyrad-643d352eb2008a4d8d09b143c684e4be7a22da26.tar.xz
tinyrad-643d352eb2008a4d8d09b143c684e4be7a22da26.zip
tests: auditing code and replacing strdup() with tinyrad_strdup()
-rw-r--r--tests/test-array-queue.c2
-rw-r--r--tests/test-array-sorted.c2
-rw-r--r--tests/test-array-stack.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/tests/test-array-queue.c b/tests/test-array-queue.c
index 3f06021..d95c13f 100644
--- a/tests/test-array-queue.c
+++ b/tests/test-array-queue.c
@@ -217,7 +217,7 @@ int main( int argc, char * argv[] )
217 { 217 {
218 data[pos].value = (int)(~pos); 218 data[pos].value = (int)(~pos);
219 data[pos].opts = (int)pos; 219 data[pos].opts = (int)pos;
220 data[pos].name = (pos < len) ? strdup(test_strs[pos]) : trutils_strrand(8, 8); 220 data[pos].name = (pos < len) ? tinyrad_strdup(test_strs[pos]) : trutils_strrand(8, 8);
221 if (!(data[pos].name)) 221 if (!(data[pos].name))
222 { 222 {
223 for(; (pos > 0); pos--) 223 for(; (pos > 0); pos--)
diff --git a/tests/test-array-sorted.c b/tests/test-array-sorted.c
index 445f240..b1c4a9b 100644
--- a/tests/test-array-sorted.c
+++ b/tests/test-array-sorted.c
@@ -287,7 +287,7 @@ int main( int argc, char * argv[] )
287 { 287 {
288 data[pos].value = (int)(~pos); 288 data[pos].value = (int)(~pos);
289 data[pos].opts = (int)pos; 289 data[pos].opts = (int)pos;
290 data[pos].name = (pos < len) ? strdup(test_strs[pos]) : trutils_strrand(8, 8); 290 data[pos].name = (pos < len) ? tinyrad_strdup(test_strs[pos]) : trutils_strrand(8, 8);
291 if (!(data[pos].name)) 291 if (!(data[pos].name))
292 { 292 {
293 for(; (pos > 0); pos--) 293 for(; (pos > 0); pos--)
diff --git a/tests/test-array-stack.c b/tests/test-array-stack.c
index 9d94da6..e73e4e8 100644
--- a/tests/test-array-stack.c
+++ b/tests/test-array-stack.c
@@ -217,7 +217,7 @@ int main( int argc, char * argv[] )
217 { 217 {
218 data[pos].value = (int)(~pos); 218 data[pos].value = (int)(~pos);
219 data[pos].opts = (int)pos; 219 data[pos].opts = (int)pos;
220 data[pos].name = (pos < len) ? strdup(test_strs[pos]) : trutils_strrand(8, 8); 220 data[pos].name = (pos < len) ? tinyrad_strdup(test_strs[pos]) : trutils_strrand(8, 8);
221 if (!(data[pos].name)) 221 if (!(data[pos].name))
222 { 222 {
223 for(; (pos > 0); pos--) 223 for(; (pos > 0); pos--)