Skip to content

Commit 55fd1d6

Browse files
author
core software devel
committed
Solve bug with osadl misinitialization. Increase version
1 parent 5980457 commit 55fd1d6

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

inc/scanoss.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#define WFP_REC_LN 18
4141

4242
/* Log files */
43-
#define SCANOSS_VERSION "5.4.4"
43+
#define SCANOSS_VERSION "5.4.5"
4444
#define SCAN_LOG "/tmp/scanoss_scan.log"
4545
#define MAP_DUMP "/tmp/scanoss_map.dump"
4646
#define SLOW_QUERY_LOG "/tmp/scanoss_slow_query.log"

src/license.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ bool osadl_load_file(void)
117117
scanlog("Warning: Cannot find OSADL definition. Please check that %s is present\n", path);
118118
else
119119
result = true;
120-
121120
free(path);
122121
return result;
123122
}
@@ -172,10 +171,14 @@ int osadl_print_license(char *output, const char *license, bool more_keys_after)
172171
void print_osadl_license_data(char *license)
173172
{
174173
char output[MAX_FIELD_LN];
175-
osadl_print_license(output, license, false);
176-
printf("{\"%s\": {%s}}", license, output);
174+
int len = osadl_print_license(output, license, false);
175+
if (len >0)
176+
printf("{\"%s\": {%s}}", license, output);
177+
else
178+
printf("{\"%s\": {}}", license);
177179
}
178180

181+
179182
static char *json_from_license(uint32_t *crclist, char *buffer, char *license, int src, bool *first_record)
180183
{
181184
clean_license(license);

src/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ int main(int argc, char **argv)
341341
break;
342342

343343
case 'l':
344+
initialize_ldb_tables(ldb_db_name);
344345
print_osadl_license_data(optarg);
345346
exit(EXIT_SUCCESS);
346347
break;
@@ -362,6 +363,7 @@ int main(int argc, char **argv)
362363
force_snippet_scan = true;
363364
break;
364365
case 't':
366+
initialize_ldb_tables(ldb_db_name);
365367
scan_benchmark();
366368
exit(EXIT_SUCCESS);
367369
break;
@@ -409,7 +411,7 @@ int main(int argc, char **argv)
409411
else
410412
{
411413
printf("'libhpsm.so' must be present in the system to execute this command\n");
412-
exit(1);
414+
exit(EXIT_FAILURE);
413415
}
414416
break;
415417
}

0 commit comments

Comments
 (0)