VirtualBox

Changeset 2962 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
May 31, 2007 1:17:41 PM (18 years ago)
Author:
vboxsync
Message:

Don't use putenv if possible as setenv is more correct. The reason is that putenv expects a parameter which gets part of the environment. If the passed string is changed, the environment changes as well. Passing an automatic variable to putenv is a bug. Though it isn't wrong to pass a constant since a constant string goes never away. But gcc-4.2 warns about it.

Location:
trunk/src/VBox/Frontends/VBoxSDL
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp

    r614 r2962  
    126126    /* On some X servers the mouse is stuck inside the bottom right corner.
    127127     * See http://wiki.clug.org.za/wiki/QEMU_mouse_not_working */
    128     putenv("SDL_VIDEO_X11_DGAMOUSE=0");
     128    setenv("SDL_VIDEO_X11_DGAMOUSE", "0", 1);
    129129#endif
    130130    rc = SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_NOPARACHUTE);
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDLTest.cpp

    r613 r2962  
    103103    _putenv("SDL_VIDEO_WINDOW_POS=0,0");
    104104#else
    105     putenv("SDL_VIDEO_WINDOW_POS=0,0");
     105    setenv("SDL_VIDEO_WINDOW_POS", "0,0", 1);
    106106#endif
    107107
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette