Skip to content

Commit

Permalink
satisfy -Werror=format-security
Browse files Browse the repository at this point in the history
  • Loading branch information
sagb committed Apr 29, 2017
1 parent 6bab626 commit 0f3df6e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/rp.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,18 @@ int rp_startupWintasks()
ratpoison_cmd = (char *)malloc(MAXPATHSZ); // we don't free it, hopefully run only once
FILE *fp;
char *fr;
char *errpr = "can't find ratpoison executable\n";
// search in PATH on startup only,
// then execv() for speed
if ((fp = popen("which ratpoison", "r"))) {
fr = fgets(ratpoison_cmd, MAXPATHSZ, fp);
if (fr == NULL) {
fprintf(stderr, errpr);
fprintf(stderr, "can't find ratpoison executable\n");
return 0;
}
pclose(fp);
}
if (strlen(ratpoison_cmd) < 2) {
fprintf(stderr, errpr);
fprintf(stderr, "can't find ratpoison executable\n");
return 0;
} else {
ratpoison_cmd[strcspn(ratpoison_cmd, "\r\n")] = 0;
Expand Down

0 comments on commit 0f3df6e

Please sign in to comment.