diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-04-21 07:06:18 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-04-21 07:06:18 +0200 |
| commit | 24885b3810c653eade5feb324e6f1619fcbf0bb2 (patch) | |
| tree | 228667a80e9bcdbd681dbd06e5752ee1b76c386b | |
| parent | 2b904ccef43f88b53b23f9a9159f7bad72d37574 (diff) | |
Minor improvement of get_prog_name().
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index 5889a62b5..57c6e6819 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -979,19 +979,19 @@ static Fl_Window *calc_transient_parent(int ¢er_x, int ¢er_y) { } -static char *get_prog_name() { +static const char *get_prog_name() { pid_t pid = getpid(); char fname[100]; sprintf(fname, "/proc/%u/cmdline", pid); FILE *in = fopen(fname, "r"); if (in) { static char line[200]; - char *p = fgets(line, sizeof(line), in); + const char *p = fgets(line, sizeof(line), in); fclose(in); p = strrchr(line, '/'); if (!p) p = line; else p++; return p; } - return NULL; + return "unknown"; } |
