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:
Ove Kaaven
1999-04-13 12:29:59 +00:00
parent ea1395db1f
commit 4400c1a450

View File

@@ -24,6 +24,9 @@
#pragma hdrstop
#endif
#define _ISOC9X_SOURCE 1 // to get vsscanf()
#define _BSD_SOURCE 1 // to still get strdup()
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -137,7 +140,7 @@ int WXDLLEXPORT wxFprintf(FILE *stream, const wxChar *fmt, ...)
int ret;
va_start(argptr, fmt);
ret = wxFvprintf(stream, fmt, argptr);
ret = wxVfprintf(stream, fmt, argptr);
va_end(argptr);
return ret;
}
@@ -170,6 +173,26 @@ int WXDLLEXPORT wxVsprintf(wxChar *buf, const wxChar *fmt, va_list argptr)
wxStrcpy(buf,str.c_str());
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
#ifndef wxAtof