ref: 5e2df0a52e67fb9c696aec68ec5ee0b466eac6a9
parent: e326cd331eb5c4bfef220a54fc2fe527613ca147
author: Turo Lamminen <turotl@gmail.com>
date: Sat Jan 6 10:02:00 EST 2018
textscreen: Don't ignore return value of system() call
--- a/textscreen/txt_window.c
+++ b/textscreen/txt_window.c
@@ -526,6 +526,7 @@
{
char *cmd;
size_t cmd_len;
+ int retval;
cmd_len = strlen(url) + 30;
cmd = malloc(cmd_len);
@@ -546,8 +547,13 @@
TXT_snprintf(cmd, cmd_len, "xdg-open \"%s\"", url);
#endif
- system(cmd);
+ retval = system(cmd);
free(cmd);
+ if (retval != 0)
+ {
+ fprintf(stderr, "TXT_OpenURL: error executing '%s'; return code %d\n",
+ cmd, retval);
+ }
}
#endif /* #ifndef _WIN32 */