diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-01-21 16:03:59 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-01-21 16:03:59 +0100 |
| commit | 83ecdd183ad738bca1f763b8d1c068d729ff2b0c (patch) | |
| tree | 6c3b2f23fec7c2ae7875af86ed1499251b836dc4 | |
| parent | ba729e50b7cd9f48903ad6597ef0bcaaf44e697e (diff) | |
Remove incorrect putenv(buf) call followed by free(buf).
| -rw-r--r-- | src/drivers/X11/Fl_X11_Screen_Driver.cxx | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx index 34310a8dc..28083d8ca 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx @@ -125,22 +125,7 @@ Fl_Screen_Driver *Fl_Screen_Driver::newScreenDriver() void Fl_X11_Screen_Driver::display(const char *d) { - if (!d) return; - - static const char *cmd = "DISPLAY="; - static const char *ext = ":0.0"; - int nc = strlen(cmd); - int ne = strlen(ext); - int nd = strlen(d); - - char *buf = (char *)malloc(nc+ne+nd+1); - strcpy(buf, cmd); - strcat(buf, d); - if (!strchr(d, ':')) { - strcat(buf, ext); - } - putenv(buf); - free(buf); + if (d) setenv("DISPLAY", d, 1); } |
