From 83ecdd183ad738bca1f763b8d1c068d729ff2b0c Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 21 Jan 2019 16:03:59 +0100 Subject: Remove incorrect putenv(buf) call followed by free(buf). --- src/drivers/X11/Fl_X11_Screen_Driver.cxx | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'src/drivers') 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); } -- cgit v1.2.3