mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Added STRLCPY_DEFINED
SVN revision: 1257
This commit is contained in:
parent
88b936b7f9
commit
2fa4739faa
2
Makefile
2
Makefile
@ -42,7 +42,7 @@ regex.o: src/regex.c src/regex.h
|
|||||||
$(CC) $(CFLAGS) -c -o regex.o src/regex.c
|
$(CC) $(CFLAGS) -c -o regex.o src/regex.c
|
||||||
|
|
||||||
mxml.o: src/mxml.c src/mxml.h
|
mxml.o: src/mxml.c src/mxml.h
|
||||||
$(CC) $(CFLAGS) -c -o mxml.o src/mxml.c
|
$(CC) $(CFLAGS) -DSTRLCPY_DEFINED -c -o mxml.o src/mxml.c
|
||||||
|
|
||||||
elogd: src/elogd.c regex.o mxml.o
|
elogd: src/elogd.c regex.o mxml.o
|
||||||
$(CC) $(CFLAGS) -o elogd src/elogd.c regex.o mxml.o $(LIBS)
|
$(CC) $(CFLAGS) -o elogd src/elogd.c regex.o mxml.o $(LIBS)
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
Contents: Electronic logbook utility
|
Contents: Electronic logbook utility
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.24 2005/03/21 16:06:48 ritt
|
||||||
|
Added STRLCPY_DEFINED
|
||||||
|
|
||||||
Revision 1.23 2005/01/15 17:05:09 midas
|
Revision 1.23 2005/01/15 17:05:09 midas
|
||||||
Changed comment
|
Changed comment
|
||||||
|
|
||||||
@ -195,6 +198,8 @@ int equal_ustring(char *str1, char *str2)
|
|||||||
|
|
||||||
/*---- strlcpy and strlcat to avoid buffer overflow ----------------*/
|
/*---- strlcpy and strlcat to avoid buffer overflow ----------------*/
|
||||||
|
|
||||||
|
#ifndef STRLCPY_DEFINED
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copy src to string dst of size siz. At most siz-1 characters
|
* Copy src to string dst of size siz. At most siz-1 characters
|
||||||
* will be copied. Always NUL terminates (unless size == 0).
|
* will be copied. Always NUL terminates (unless size == 0).
|
||||||
@ -258,6 +263,8 @@ size_t strlcat(char *dst, const char *src, size_t size)
|
|||||||
return (dlen + (s - src)); /* count does not include NUL */
|
return (dlen + (s - src)); /* count does not include NUL */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // STRLCPY_DEFINED
|
||||||
|
|
||||||
/*-------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------*/
|
||||||
|
|
||||||
void btou(char *str)
|
void btou(char *str)
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
Contents: Midas XML Library
|
Contents: Midas XML Library
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.7 2005/03/21 16:05:21 ritt
|
||||||
|
Added STRLCPY_DEFINED
|
||||||
|
|
||||||
Revision 1.6 2005/03/21 16:02:08 ritt
|
Revision 1.6 2005/03/21 16:02:08 ritt
|
||||||
Added code for strlcpy/cat ifndef STRLCPY_DEFINED
|
Added code for strlcpy/cat ifndef STRLCPY_DEFINED
|
||||||
|
|
||||||
@ -66,7 +69,7 @@ typedef int BOOL;
|
|||||||
#ifdef STRLCPY_DEFINED
|
#ifdef STRLCPY_DEFINED
|
||||||
|
|
||||||
extern size_t strlcpy(char *dst, const char *src, size_t size);
|
extern size_t strlcpy(char *dst, const char *src, size_t size);
|
||||||
extern size_t strlcat(char *dst, const char *src, size_t size)
|
extern size_t strlcat(char *dst, const char *src, size_t size);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user