Skip to content

Commit

Permalink
Merge pull request #73 from scanoss/5.4.6
Browse files Browse the repository at this point in the history
remove quotation marks from file path, add forks to helth report
  • Loading branch information
mscasso-scanoss authored May 29, 2024
2 parents 3d1ae68 + 72774ca commit 89697e4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion inc/scanoss.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#define WFP_REC_LN 18

/* Log files */
#define SCANOSS_VERSION "5.4.5"
#define SCANOSS_VERSION "5.4.6"
#define SCAN_LOG "/tmp/scanoss_scan.log"
#define MAP_DUMP "/tmp/scanoss_map.dump"
#define SLOW_QUERY_LOG "/tmp/scanoss_slow_query.log"
Expand Down
2 changes: 1 addition & 1 deletion inc/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void remove_char(char *str, char chr);
bool stristart(char *a, char *b);

/* Cleans str from unprintable characters or quotes */
void string_clean(char *str);
char * string_clean(char *str);

/* Calculates crc32c for a string */
uint32_t string_crc32c(char *str);
Expand Down
3 changes: 2 additions & 1 deletion src/health.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ bool print_health_item(uint8_t *key, uint8_t *subkey, int subkey_ln, uint8_t *da
len += sprintf(&result[len],"\"last_update\":\"%s\", ", isalnum(*last_update) ? last_update : " ");
len += sprintf(&result[len],"\"last_push\":\"%s\", ", isalnum(*last_push) ? last_push : " ");
len += sprintf(&result[len],"\"stars\":%s, ", isdigit(*watchers_count) ? watchers_count : "null");
len += sprintf(&result[len],"\"issues\":%s} ", isdigit(*issues_count) ? issues_count : "null");
len += sprintf(&result[len],"\"issues\":%s, ", isdigit(*issues_count) ? issues_count : "null");
len += sprintf(&result[len],"\"forks\":%s} ", isdigit(*forks_count) ? forks_count : "null");
len += sprintf(&result[len],",\"provenance\":\"%s\"",isalpha(*provenance) ? provenance : " ");

match->health_text = strdup(result);
Expand Down
2 changes: 1 addition & 1 deletion src/report.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ bool print_json_component(component_data_t * component)
printf("\"download_url\": \"%s\",", component->url);

printf("\"release_date\": \"%s\",", component->release_date);
printf("\"file\": \"%s\",", component->url_match == true ? basename(component->url) : component->file);
printf("\"file\": \"%s\",", component->url_match == true ? basename(component->url) : string_clean(component->file));
if (engine_flags & ENABLE_PATH_HINT)
printf("\"path_rank\": %d,", component->path_rank);

Expand Down
3 changes: 2 additions & 1 deletion src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void remove_char(char *str, char chr)
* @brief Cleans str from unprintable characters or quotes
* @param str string to be processed
*/
void string_clean(char *str)
char * string_clean(char *str)
{
char *s = str;
while (*s)
Expand All @@ -178,6 +178,7 @@ void string_clean(char *str)
}

json_remove_invalid_char(str);
return str;
}

char * json_remove_invalid_char(char * input)
Expand Down

0 comments on commit 89697e4

Please sign in to comment.