Changeset 270


Ignore:
Timestamp:
Mar 3, 2011, 3:12:29 PM (14 years ago)
Author:
dmik
Message:

java_props_md.c: More GCC warnings and also fixed a wrong array subscript which could theoretically cause a failed memory access.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openjdk/jdk/src/windows/native/java/lang/java_props_md.c

    r269 r270  
    2626#ifdef __WIN32OS2__
    2727#define INCL_DOSMISC
     28#define INCL_DOSNLS
    2829#include <os2wrap2.h>
    2930#endif
     
    706707        sprintf(buf, "%lu.%lu", ver[0], ver[1]);
    707708        sprops.os_version = strdup(buf);
    708         sprintf(buf, "%lu", ver[3]);
     709        sprintf(buf, "%lu", ver[2]);
    709710        sprops.patch_level = strdup(buf);
    710711
     
    883884        } else {
    884885            char buf[100];
    885             int buflen = sizeof(buf);
     886            DWORD buflen = sizeof(buf);
    886887            sprops.user_name =
    887888                GetUserName(buf, &buflen) ? strdup(buf) : "unknown";
     
    988989                    static char encoding[16];
    989990                    os2_ULONG cp[3], len;
    990                     DosQueryCp(sizeof(cp), &cp, &len);
     991                    DosQueryCp(sizeof(cp), cp, &len);
    991992                    sprintf(encoding, "Cp%lu", cp[0]);
    992993                    sprops.encoding =  encoding;
Note: See TracChangeset for help on using the changeset viewer.