Fixed a typo. Added sloppy implementation of wxSscanf (converts source and format,
then calls vsscanf; use only on number arguments!) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2138 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -24,6 +24,9 @@
|
|||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define _ISOC9X_SOURCE 1 // to get vsscanf()
|
||||||
|
#define _BSD_SOURCE 1 // to still get strdup()
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -137,7 +140,7 @@ int WXDLLEXPORT wxFprintf(FILE *stream, const wxChar *fmt, ...)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
ret = wxFvprintf(stream, fmt, argptr);
|
ret = wxVfprintf(stream, fmt, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -170,6 +173,26 @@ int WXDLLEXPORT wxVsprintf(wxChar *buf, const wxChar *fmt, va_list argptr)
|
|||||||
wxStrcpy(buf,str.c_str());
|
wxStrcpy(buf,str.c_str());
|
||||||
return str.Len();
|
return str.Len();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int WXDLLEXPORT wxSscanf(const wxChar *buf, const wxChar *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list argptr;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
va_start(argptr, fmt);
|
||||||
|
ret = wxVsscanf(buf, fmt, argptr);
|
||||||
|
va_end(argptr);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int WXDLLEXPORT wxVsscanf(const wxChar *buf, const wxChar *fmt, va_list argptr)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
// this will work only for numeric conversion! Strings will not be converted correctly
|
||||||
|
// hopefully this is all we'll need
|
||||||
|
ret = vsscanf(wxConv_libc.cWX2MB(buf), wxConv_libc.cWX2MB(fmt), argptr);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef wxAtof
|
#ifndef wxAtof
|
||||||
|
Reference in New Issue
Block a user