xbps-query/search.c: use unsigned int and remove wrong cast.

This commit is contained in:
Juan RP 2020-02-22 14:18:35 +01:00
parent 68747a12e4
commit 6236d7ae41

View File

@ -46,7 +46,7 @@
struct search_data { struct search_data {
bool regex, repo_mode; bool regex, repo_mode;
regex_t regexp; regex_t regexp;
int maxcols; unsigned int maxcols;
const char *pat, *prop, *repourl; const char *pat, *prop, *repourl;
xbps_array_t results; xbps_array_t results;
}; };
@ -79,7 +79,7 @@ print_results(struct xbps_handle *xhp, struct search_data *sd)
inststr = "[-]"; inststr = "[-]";
len = strlen(inststr) + strlen(tmp) + strlen(desc) + 3; len = strlen(inststr) + strlen(tmp) + strlen(desc) + 3;
if (sd->maxcols && (int)len > sd->maxcols) { if (sd->maxcols && len > sd->maxcols) {
out = malloc(sd->maxcols+1); out = malloc(sd->maxcols+1);
assert(out); assert(out);
snprintf(out, sd->maxcols-3, "%s %s %s", snprintf(out, sd->maxcols-3, "%s %s %s",