You are not logged in.

#1 2007-01-14 05:59:33

oseb
Member
From: Busan, Korea
Registered: 2005-05-26
Posts: 31

where is strlcpy() and strlcat() ?

there are no strlcpy and strlcat in my /usr/include/string.h header file.
where are those?
source code is http://www.kipple.pe.kr/win/unalz/unalz-0.60.tgz

unalz # make linux-utf8
g++    -c -o main.o main.cpp
g++    -c -o UnAlz.o UnAlz.cpp
UnAlz.cpp: In function 'void safe_strcpy(char*, const char*, size_t)':
UnAlz.cpp:113: error: 'strlcpy' was not declared in this scope
UnAlz.cpp: In function 'void safe_strcat(char*, const char*, size_t)':
UnAlz.cpp:123: error: 'strlcat' was not declared in this scope
make: *** [UnAlz.o] Error 1
unalz # man strlcat
No manual entry for strlcat
unalz # man strlcpy
No manual entry for strlcpy
unalz # pacman -Qs glibc
local/glibc 2.5-3
    GNU C Library

Offline

#2 2007-01-14 11:32:30

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: where is strlcpy() and strlcat() ?

try strcpy and strcat from string.h

Offline

#3 2007-01-14 11:45:32

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: where is strlcpy() and strlcat() ?

Does this help:

In glib these functions are named g_strlcpy and g_strlcat (not strlcpy or strlcat) to be consistent with the glib library naming conventions.

You'll find them in /usr/include/glib-2.0/glib/gstrfuncs.h, provided by the glib2 package.

Offline

#4 2007-01-14 13:09:03

oseb
Member
From: Busan, Korea
Registered: 2005-05-26
Posts: 31

Re: where is strlcpy() and strlcat() ?

strcpy and strcat is not work, but strncpy and strncat work fine.
this souce only cui command. not need glib2 and i tried to g_strlcpy and g_strncat, but not worked. i think more modified.

i fonund strlcpy patch file in LSF. http://www.linuxfromscratch.org/patches … at-1.patch

i apply patch to glibc and rebuild source code. it works.
why linux not those function include? ubuntu glibc also not include. i mailed to developer to fix them.

sorry poof my english.
thanks T-Dawg, tomk.

--
[append]
strncpy and strncat is complie work. not correct function. wierd work.

Offline

#5 2007-01-14 18:55:37

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: where is strlcpy() and strlcat() ?

Maybe you need the functions from bind:
/usr/include/isc/string.h

Offline

Board footer

Powered by FluxBB