Commit 779c1f80 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Don't call invalid parameter handler when string to be tokenized and…

msvcrt: Don't call invalid parameter handler when string to be tokenized and context are not set in mbstok.
parent e1b4334f
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "stdlib.h" #include "stdlib.h"
#include "errno.h" #include "errno.h"
#include "malloc.h" #include "malloc.h"
#include "mbstring.h"
#include "limits.h" #include "limits.h"
#include "sys/stat.h" #include "sys/stat.h"
#include "windef.h" #include "windef.h"
...@@ -489,6 +490,11 @@ int CDECL MSVCR100_atoi(const char *str) ...@@ -489,6 +490,11 @@ int CDECL MSVCR100_atoi(const char *str)
return _atoi_l(str, NULL); return _atoi_l(str, NULL);
} }
unsigned char* CDECL MSVCR100__mbstok(unsigned char *str, const unsigned char *delim)
{
return _mbstok_l(str, delim, NULL);
}
/********************************************************************* /*********************************************************************
* DllMain (MSVCR100.@) * DllMain (MSVCR100.@)
*/ */
......
...@@ -1182,7 +1182,7 @@ ...@@ -1182,7 +1182,7 @@
@ stub _mbsspnp_l @ stub _mbsspnp_l
@ cdecl _mbsstr(str str) msvcrt._mbsstr @ cdecl _mbsstr(str str) msvcrt._mbsstr
@ stub _mbsstr_l @ stub _mbsstr_l
@ cdecl _mbstok(str str) msvcrt._mbstok @ cdecl _mbstok(str str) MSVCR100__mbstok
@ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l @ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l
@ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s @ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s
@ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l @ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l
......
...@@ -1544,7 +1544,7 @@ ...@@ -1544,7 +1544,7 @@
@ stub _mbsspnp_l @ stub _mbsspnp_l
@ cdecl _mbsstr(str str) msvcrt._mbsstr @ cdecl _mbsstr(str str) msvcrt._mbsstr
@ stub _mbsstr_l @ stub _mbsstr_l
@ cdecl _mbstok(str str) msvcrt._mbstok @ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt
@ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l @ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l
@ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s @ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s
@ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l @ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l
......
...@@ -468,7 +468,7 @@ ...@@ -468,7 +468,7 @@
@ cdecl _mbsspn(str str) msvcrt._mbsspn @ cdecl _mbsspn(str str) msvcrt._mbsspn
@ cdecl _mbsspnp(str str) msvcrt._mbsspnp @ cdecl _mbsspnp(str str) msvcrt._mbsspnp
@ cdecl _mbsstr(str str) msvcrt._mbsstr @ cdecl _mbsstr(str str) msvcrt._mbsstr
@ cdecl _mbstok(str str) msvcrt._mbstok @ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt
@ cdecl _mbstrlen(str) msvcrt._mbstrlen @ cdecl _mbstrlen(str) msvcrt._mbstrlen
@ cdecl _mbsupr(str) msvcrt._mbsupr @ cdecl _mbsupr(str) msvcrt._mbsupr
@ cdecl _memccpy(ptr ptr long long) msvcrt._memccpy @ cdecl _memccpy(ptr ptr long long) msvcrt._memccpy
......
...@@ -463,7 +463,7 @@ ...@@ -463,7 +463,7 @@
@ cdecl _mbsspn(str str) msvcrt._mbsspn @ cdecl _mbsspn(str str) msvcrt._mbsspn
@ cdecl _mbsspnp(str str) msvcrt._mbsspnp @ cdecl _mbsspnp(str str) msvcrt._mbsspnp
@ cdecl _mbsstr(str str) msvcrt._mbsstr @ cdecl _mbsstr(str str) msvcrt._mbsstr
@ cdecl _mbstok(str str) msvcrt._mbstok @ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt
@ cdecl _mbstrlen(str) msvcrt._mbstrlen @ cdecl _mbstrlen(str) msvcrt._mbstrlen
@ cdecl _mbsupr(str) msvcrt._mbsupr @ cdecl _mbsupr(str) msvcrt._mbsupr
@ cdecl _memccpy(ptr ptr long long) msvcrt._memccpy @ cdecl _memccpy(ptr ptr long long) msvcrt._memccpy
......
...@@ -853,7 +853,7 @@ ...@@ -853,7 +853,7 @@
@ stub _mbsspnp_l @ stub _mbsspnp_l
@ cdecl _mbsstr(str str) msvcrt._mbsstr @ cdecl _mbsstr(str str) msvcrt._mbsstr
@ stub _mbsstr_l @ stub _mbsstr_l
@ cdecl _mbstok(str str) msvcrt._mbstok @ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt
@ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l @ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l
@ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s @ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s
@ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l @ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l
......
...@@ -831,7 +831,7 @@ ...@@ -831,7 +831,7 @@
@ stub _mbsspnp_l @ stub _mbsspnp_l
@ cdecl _mbsstr(str str) msvcrt._mbsstr @ cdecl _mbsstr(str str) msvcrt._mbsstr
@ stub _mbsstr_l @ stub _mbsstr_l
@ cdecl _mbstok(str str) msvcrt._mbstok @ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt
@ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l @ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l
@ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s @ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s
@ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l @ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l
......
...@@ -1149,7 +1149,12 @@ unsigned char* CDECL _mbstok_l(unsigned char *str, ...@@ -1149,7 +1149,12 @@ unsigned char* CDECL _mbstok_l(unsigned char *str,
*/ */
unsigned char* CDECL _mbstok(unsigned char *str, const unsigned char *delim) unsigned char* CDECL _mbstok(unsigned char *str, const unsigned char *delim)
{ {
return _mbstok_s_l(str, delim, &msvcrt_get_thread_data()->mbstok_next, NULL); thread_data_t *data = msvcrt_get_thread_data();
if(!str && !data->mbstok_next)
return NULL;
return _mbstok_s_l(str, delim, &data->mbstok_next, NULL);
} }
/********************************************************************* /*********************************************************************
......
...@@ -102,6 +102,7 @@ size_t __cdecl _mbsspn(const unsigned char*,const unsigned char*); ...@@ -102,6 +102,7 @@ size_t __cdecl _mbsspn(const unsigned char*,const unsigned char*);
unsigned char* __cdecl _mbsspnp(const unsigned char*,const unsigned char*); unsigned char* __cdecl _mbsspnp(const unsigned char*,const unsigned char*);
unsigned char* __cdecl _mbsstr(const unsigned char*,const unsigned char*); unsigned char* __cdecl _mbsstr(const unsigned char*,const unsigned char*);
unsigned char* __cdecl _mbstok(unsigned char*,const unsigned char*); unsigned char* __cdecl _mbstok(unsigned char*,const unsigned char*);
unsigned char* __cdecl _mbstok_l(unsigned char*,const unsigned char*,_locale_t);
unsigned char* __cdecl _mbsupr(unsigned char*); unsigned char* __cdecl _mbsupr(unsigned char*);
#ifndef _MBLEADTRAIL_DEFINED #ifndef _MBLEADTRAIL_DEFINED
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment