We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 251 - SDL_WINDOWID envvar no longer accepts hex values
Summary: SDL_WINDOWID envvar no longer accepts hex values
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 1.2.10
Hardware: x86 Windows (XP)
: P2 minor
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-14 09:31 UTC by Kyle J. Harms
Modified: 2006-06-20 01:57 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle J. Harms 2006-06-14 09:31:46 UTC
In previous versions of SDL the SDL_WINDOWID environment variable would accept a value in decimal or in hex (prefixed by 0x).  However 1.2.10 does not accept values in hexidecimal.  An easy fix is to change the SDL_strtoull function in stdlib/sdl_string.c to understand the 0x prefix.

#ifndef HAVE_STRTOULL
Uint64 SDL_strtoull(const char *string, char **endp, int base)
{
    size_t len;
    Uint64 value;

    // Check for base 16
    if ( !base ) {
        if ( (strlen(string) > 2) && (strncmp(string, "0x", 2) == 0) ) {
            base = 16;
        } else {
            base = 10;
        }
    }        

    len = SDL_ScanUnsignedLongLong(string, base, &value);
    if ( endp ) {
        *endp = (char *)string + len;
    }
    return value;
}
Comment 1 Sam Lantinga 2006-06-20 01:57:36 UTC
This is fixed in subversion, thanks!