Don't rely on sscanf() doesn't care about unused suffixes of the status
string. Use strstr() instead to make sure only actually installed
packages are returned.
Suggested-by: Eric Fahlgren <ericfahlgren@gmail.com>
Reported-by: Eric Fahlgren <ericfahlgren@gmail.com>
Fixes: #6
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://github.com/openwrt/rpcd/pull/8
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
break;
case 'S':
if (is_field("Status", line))
- if (sscanf(line, "Status: install %63s installed", tmp) == 1)
- installed = true;
+ installed = !!strstr(line, " installed");
break;
default:
if (is_blank(line)) {