Fix compile warnings for tests

pull/15/merge
Michael Black W9MDB 2018-04-16 10:39:05 -05:00 zatwierdzone przez Nate Bargmann
rodzic 1e883d0195
commit abca0653fd
2 zmienionych plików z 6 dodań i 8 usunięć

Wyświetl plik

@ -546,10 +546,10 @@ int main(int argc, char *argv[])
fprintf(stderr, "Warning: %s is not a directory!\n", hist_dir);
}
int hist_path_size = sizeof(char)*(strlen(hist_dir)+strlen(hist_file) + 1);
int hist_path_size = sizeof(char)*(strlen(hist_dir)+strlen(hist_file) + 1);
hist_path = (char *)calloc(hist_path_size, sizeof(char));
snprintf(hist_path, hist_path_size, "%s%s", hist_dir, hist_file);
snprintf(hist_path, hist_path_size, "%s%s", hist_dir, hist_file);
}
if (rd_hist && hist_path)

Wyświetl plik

@ -378,13 +378,11 @@ int main(int argc, char *argv[])
fprintf(stderr, "Warning: %s is not a directory!\n", hist_dir);
}
hist_path = (char *)calloc((sizeof(char)
* (strlen(hist_dir)
+ strlen(hist_file) + 1)),
sizeof(char));
int hist_path_size = sizeof(char)*(strlen(hist_dir)+strlen(hist_file) + 1);
hist_path = (char *)calloc(hist_path_size, sizeof(char));
snprintf(hist_path, hist_path_size, "%s%s", hist_dir, hist_file);
strncpy(hist_path, hist_dir, strlen(hist_dir));
strncat(hist_path, hist_file, strlen(hist_file));
}
if (rd_hist && hist_path)