Changeset 21754 for branches/gcc-kmk/src


Ignore:
Timestamp:
Oct 27, 2011, 6:49:38 PM (14 years ago)
Author:
dmik
Message:

GCC has snprintf().

Location:
branches/gcc-kmk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/gcc-kmk/src/oleaut32/old/typelib.cpp

    r6505 r21754  
    2525#include "itypelib.h"
    2626
     27#if defined(__WIN32OS2__) && !defined(__GNUC__)
     28#define snprintf wsnprintfA
     29#endif
     30
    2731static FILE *_privateLogFile = NULL;
    2832
     
    268272    guidA = HEAP_strdupWtoA(GetProcessHeap(), 0, guid);
    269273#ifdef __WIN32OS2__
    270     sprintf(keyName, "SOFTWARE\\Classes\\TypeLib\\%s\\%x.%x",
     274    snprintf(keyName, sizeof(keyName), "SOFTWARE\\Classes\\TypeLib\\%s\\%x.%x",
    271275            guidA, attr->wMajorVerNum, attr->wMinorVerNum);
    272276#else
     
    315319            CHAR buf[20];
    316320            /* FIXME: is %u correct? */
    317 #ifdef __WIN32OS2__
    318             sprintf(buf, "%u", attr->wLibFlags);
     321            snprintf(buf, strlen(buf), "%u", attr->wLibFlags);
    319322            if (RegSetValueExA(subKey, NULL, 0, REG_SZ,
    320323                (LPBYTE)buf, lstrlenA(buf) + 1) != ERROR_SUCCESS)
    321 #else
    322             snprintf(buf, strlen(buf), "%u", attr->wLibFlags);
    323             if (RegSetValueExA(subKey, NULL, 0, REG_SZ,
    324                 buf, lstrlenA(buf) + 1) != ERROR_SUCCESS)
    325 #endif
    326324                res = E_FAIL;
    327325        }
  • branches/gcc-kmk/src/shell32/shlfolder.c

    r21512 r21754  
    2121
    2222
    23 #ifdef __WIN32OS2__
    24 #define snprintf(a,b,c,d)       sprintf(a,c,d)
    25 #endif
    2623#include <stdlib.h>
    2724#include <string.h>
     
    4744DEFAULT_DEBUG_CHANNEL(shell);
    4845
     46#if defined(__WIN32OS2__) && !defined(__GNUC__)
     47#define snprintf wsnprintfA
     48#endif
    4949
    5050/***************************************************************************
Note: See TracChangeset for help on using the changeset viewer.