windows-nt/Source/XPSP1/NT/ds/netapi/netlib/wtol.c

54 lines
899 B
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
/*++
Copyright (c) 1991-1992 Microsoft Corporation
Module Name:
WToL.c
Abstract:
Contains wcs string functions that are not available in wcstr.h
Author:
10/29/91 madana
temp code.
Environment:
User mode only.
Contains NT-specific code.
Requires ANSI C extensions: slash-slash comments, long external names.
Tab size is set to 4.
Revision History:
09-Jan-1992 JohnRo
Moved MadanA's wcstol() from replicator svc to NetLib.
Changed name to avoid probable conflict with strtol -> wcstol routine.
--*/
#include <windef.h>
#include <tstring.h> // My prototypes.
LONG
wtol(
IN LPWSTR string
)
{
LONG value = 0;
while((*string != L'\0') &&
(*string >= L'0') &&
( *string <= L'9')) {
value = value * 10 + (*string - L'0');
string++;
}
return(value);
}