mirror of
https://github.com/clearlinux/swupd-server.git
synced 2026-08-28 13:45:42 +00:00
Fix remaining issues with handling the format number
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
+2
-2
@@ -112,7 +112,7 @@ struct manifest *manifest_from_file(int version, char *component)
|
||||
struct manifest *manifest;
|
||||
char *filename, *conf;
|
||||
int previous = 0;
|
||||
int format_number;
|
||||
unsigned long long int format_number;
|
||||
|
||||
conf = config_output_dir();
|
||||
if (conf == NULL) {
|
||||
@@ -145,7 +145,7 @@ struct manifest *manifest_from_file(int version, char *component)
|
||||
}
|
||||
c = &line[9];
|
||||
format_number = strtoull(c, NULL, 10);
|
||||
if ((errno < 0) || (format_number <= 0)) {
|
||||
if ((errno < 0) || (format_number == 0)) {
|
||||
//format string shall be a positive integer
|
||||
printf("Unknown file format version in MANIFEST line: %s\n", c);
|
||||
fclose(infile);
|
||||
|
||||
+1
-1
@@ -139,7 +139,7 @@ void write_cookiecrumbs_to_download_area(int version)
|
||||
}
|
||||
free(cmd);
|
||||
|
||||
string_or_die(&cmd, "echo %d > %s/%i/format", format, conf, version);
|
||||
string_or_die(&cmd, "echo %llu > %s/%i/format", format, conf, version);
|
||||
if (system(cmd) != 0) {
|
||||
assert(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user