Skip to content
Snippets Groups Projects
Commit 17c939f7 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix some warnings, return false for zero-length strings.

parent fd3533d5
No related branches found
No related tags found
No related merge requests found
Pipeline #6651 passed
......@@ -1257,6 +1257,8 @@ get_syncterm_filename(char *fn, int fnlen, int type, bool shared)
sprintf(fn, "%.*s", fnlen - 1, config_override);
return fn;
}
if ((type == SYNCTERM_PATH_LIST) && !shared)
fprintf(stderr, "List override = %p, type = %d (%d), shared: %d\n", list_override, type, SYNCTERM_PATH_LIST, shared);
if ((list_override != NULL) && (type == SYNCTERM_PATH_LIST) && !shared) {
sprintf(fn, "%.*s", fnlen - 1, list_override);
return fn;
......
......@@ -185,12 +185,12 @@ const char* IPv4AddressToStr(uint32_t addr, char* dest, size_t size)
static bool
isValidHostnameString(const char *str)
{
size_t pos;
size_t seglen = 0;
size_t totallen = 0;
size_t segcount = 0;
bool last_was_hyphen = false;
if (!*str)
return false;
while (*str) {
if ((*str >= 'a' && *str <= 'z')
|| (*str >= 'A' && *str <= 'Z')
......@@ -211,7 +211,6 @@ isValidHostnameString(const char *str)
if (*str == '-') {
return false;
}
segcount++;
}
seglen++;
if (seglen > 63) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment