diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-12-30 13:00:29 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-12-30 13:00:29 -0500 |
commit | d0e254663e64e40b676644038a9d7c95a2f25116 (patch) | |
tree | 193b9d0f5b58436b2ecbcb4762327c8560831a2b /src/strings.c | |
parent | 4595ada2f69b42670c85a63c7d2344af63f2afe7 (diff) | |
download | spmc-d0e254663e64e40b676644038a9d7c95a2f25116.tar.gz |
Fix inane compiler warnings
* fix rpath_set
* add rpath_autoset
* add internal command "rpath_set"
Diffstat (limited to 'src/strings.c')
-rw-r--r-- | src/strings.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/strings.c b/src/strings.c index 782d66c..95068d0 100644 --- a/src/strings.c +++ b/src/strings.c @@ -177,7 +177,7 @@ char** split(char *_sptr, const char* delim) free(sptr); return NULL; } - strncpy(result[i], token, strlen(token)); // copy the string contents into the record + memcpy(result[i], token, strlen(token) + 1); // copy the string contents into the record i++; // next record } free(orig); @@ -402,7 +402,7 @@ char **strdeldup(char **arr) { } int rec = 0; - int i = 0; + size_t i = 0; while(i < records) { // Search for value in results if (strstr_array(result, arr[i]) == 0) { @@ -417,7 +417,7 @@ char **strdeldup(char **arr) { free(result); return NULL; } - strncpy(result[rec], arr[i], strlen(arr[i])); + memcpy(result[rec], arr[i], strlen(arr[i]) + 1); i++; rec++; } @@ -526,8 +526,8 @@ void print_banner(const char *s, int len) { if (!s_len) { return; } - for (int i = 0; i < (len / s_len); i++) { - for (int c = 0; c < s_len; c++) { + for (size_t i = 0; i < (len / s_len); i++) { + for (size_t c = 0; c < s_len; c++) { putchar(s[c]); } } |