3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS system libraries
5 * FILE: lib/msvcrt/stdlib/itow.c
6 * PURPOSE: converts a integer to wchar_t
10 * 1998: Added ltoa Boudewijn Dekker
11 * 2000: derived from ./itoa.c by ea
13 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
15 #include <msvcrt/errno.h>
16 #include <msvcrt/stdlib.h>
17 #include <msvcrt/internal/file.h>
20 wchar_t* _i64tow(__int64 value, wchar_t* string, int radix)
29 if (radix > 36 || radix <= 1) {
34 sign = (radix == 10 && value < 0);
39 while (v || tp == tmp) {
45 *tp++ = i + L'a' - 10;
49 string = (wchar_t*)malloc(((tp-tmp)+sign+1)*sizeof(wchar_t));
60 wchar_t* _ui64tow(unsigned __int64 value, wchar_t* string, int radix)
65 unsigned long v = value;
68 if (radix > 36 || radix <= 1) {
73 while (v || tp == tmp) {
79 *tp++ = i + L'a' - 10;
83 string = (wchar_t*)malloc(((tp-tmp)+1)*sizeof(wchar_t));