Print this page
make: use the more modern wchar routines, not widec.h
*** 168,178 ****
/*
* First figure out how long the string is.
* If the len argument is -1 we count the chars here.
*/
if (len == FIND_LENGTH) {
! length = wslen(name);
} else {
length = len;
}
Wstring ws;
--- 168,178 ----
/*
* First figure out how long the string is.
* If the len argument is -1 we count the chars here.
*/
if (len == FIND_LENGTH) {
! length = wcslen(name);
} else {
length = len;
}
Wstring ws;
*** 679,700 ****
*/
void
append_string(register wchar_t *from, register String to, register int length)
{
if (length == FIND_LENGTH) {
! length = wslen(from);
}
if (to->buffer.start == NULL) {
expand_string(to, 32 + length);
}
if (to->buffer.end - to->text.p <= length) {
expand_string(to,
(to->buffer.end - to->buffer.start) * 2 +
length);
}
if (length > 0) {
! (void) wsncpy(to->text.p, from, length);
to->text.p += length;
}
*(to->text.p) = (int) nul_char;
}
--- 679,700 ----
*/
void
append_string(register wchar_t *from, register String to, register int length)
{
if (length == FIND_LENGTH) {
! length = wcslen(from);
}
if (to->buffer.start == NULL) {
expand_string(to, 32 + length);
}
if (to->buffer.end - to->text.p <= length) {
expand_string(to,
(to->buffer.end - to->buffer.start) * 2 +
length);
}
if (length > 0) {
! (void) wcsncpy(to->text.p, from, length);
to->text.p += length;
}
*(to->text.p) = (int) nul_char;
}
*** 765,775 ****
* Get more memory, copy the string and free the old buffer if
* it is was malloc()'ed.
*/
expandstring_count++;
p = ALLOC_WC(length);
! (void) wscpy(p, string->buffer.start);
string->text.p = p + (string->text.p - string->buffer.start);
string->text.end = p + (string->text.end - string->buffer.start);
string->buffer.end = p + length;
if (string->free_after_use) {
retmem(string->buffer.start);
--- 765,775 ----
* Get more memory, copy the string and free the old buffer if
* it is was malloc()'ed.
*/
expandstring_count++;
p = ALLOC_WC(length);
! (void) wcscpy(p, string->buffer.start);
string->text.p = p + (string->text.p - string->buffer.start);
string->text.end = p + (string->text.end - string->buffer.start);
string->buffer.end = p + length;
if (string->free_after_use) {
retmem(string->buffer.start);