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

Summary: SDL_WINDOWID envvar no longer accepts hex values
Product: SDL Reporter: Kyle J. Harms <kyle.j.harms>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2    
Version: 1.2.10   
Hardware: x86   
OS: Windows (XP)   

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!