rs

FTDI serial communication program
git clone git://git.2f30.org/rs
Log | Files | Refs | README | LICENSE

commit 60a899185dad84b492a9ad0ba58b6a8de0025f92
parent 26aeebd61245b1d49a35caaa1bf01effeb962426
Author: sin <sin@2f30.org>
Date:   Sat, 16 Nov 2013 18:00:32 +0000

Remove strlcpy()

Diffstat:
MMakefile | 3+--
Mutil.h | 1-
Dutil/strlcpy.c | 15---------------
3 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/Makefile b/Makefile @@ -5,8 +5,7 @@ include config.mk LIB = \ util/eprintf.o \ - util/estrtol.o \ - util/strlcpy.o + util/estrtol.o SRC = rs.c diff --git a/util.h b/util.h @@ -8,4 +8,3 @@ extern char *argv0; void enprintf(int, const char *, ...); void eprintf(const char *, ...); long estrtol(const char *, int); -size_t strlcpy(char *dest, const char *src, size_t size); diff --git a/util/strlcpy.c b/util/strlcpy.c @@ -1,15 +0,0 @@ -#include <stdio.h> -#include <string.h> - -size_t -strlcpy(char *dest, const char *src, size_t size) -{ - size_t ret = strlen(src); - - if (size) { - size_t len = (ret >= size) ? size - 1 : ret; - memcpy(dest, src, len); - dest[len] = '\0'; - } - return ret; -}