char *out, *err;
char **lines;
+ if (strlen (encoding) != 1 ||
+ strchr ("sSblBL", encoding[0]) == NULL) {
+ reply_with_error ("%s: invalid encoding", encoding);
+ return NULL;
+ }
+
buf = sysroot_path (path);
if (!buf) {
reply_with_perror ("malloc");
r = command (&out, &err, "strings", "-e", encoding, buf, NULL);
free (buf);
if (r == -1) {
- reply_with_error ("strings: %s: %s", path, err);
+ reply_with_error ("%s: %s", path, err);
free (err);
free (out);
return NULL;