opensc/src/common
René Liebscher 4d96fbfed4 Remove compiler warnings/errors
Recent compilers have activated some additional
checks which let the build fail. (at least with cygwin)
(Normally it would be warnings but opensc compiles
with -Werror)

GCC 9.3:
In file included from profile.c:27:
profile.c: In function '__expr_get':
profile.c:2273:18: error: array subscript has type 'char' [-Werror=char-subscripts]
 2273 |   while (isspace(*s))
      |                  ^~

clang 8.0.1:
compat_getopt_main.c:102:22: error: array subscript is of type 'char' [-Werror,-Wchar-subscripts]
                rc = toupper(rc);
                     ^~~~~~~~~~~
/usr/include/ctype.h:161:25: note: expanded from macro 'toupper'
      (void) __CTYPE_PTR[__x]; (toupper) (__x);})
                        ^~~~

Actually the code is correct as isspace and others
are used here with data type char, and are to be used
with data type int.

So either the compiler should have deactivated
this error, or the ctype.h macros have to be
written so the compiler no longer complains.

As there is also a simple workaround by casting
char to unsigned char, there is no need to wait for one
of the former options to be happen sometime.
2020-06-22 10:47:02 +02:00
..
ChangeLog.compat_getopt Complete rewrite of OpenSC build system. 2008-03-06 16:06:59 +00:00
LICENSE.compat_getopt Complete rewrite of OpenSC build system. 2008-03-06 16:06:59 +00:00
Makefile.am fixed more clang-tidy warnings 2019-06-05 13:48:51 +02:00
Makefile.mak fixed unused dependency 2017-11-09 12:42:29 +01:00
README.compat_getopt fix typos 2018-04-15 09:34:45 +02:00
README.compat_strlcpy fix typos 2018-04-15 09:34:45 +02:00
compat___iob_func.c fixed compiler warnings 2017-11-09 12:42:29 +01:00
compat_dummy.c add a prototype for compat_dummy() 2008-05-22 12:14:39 +00:00
compat_getopt.3 Complete rewrite of OpenSC build system. 2008-03-06 16:06:59 +00:00
compat_getopt.c fixed issues reported by clang-analyzer 2019-05-21 19:34:46 +02:00
compat_getopt.h use compat_getopt_long if getopt_long is not available 2019-03-25 14:30:09 +01:00
compat_getopt.txt Complete rewrite of OpenSC build system. 2008-03-06 16:06:59 +00:00
compat_getopt_main.c Remove compiler warnings/errors 2020-06-22 10:47:02 +02:00
compat_getpass.c honour HAVE_CONFIG_H 2015-04-22 23:55:33 +02:00
compat_getpass.h Complete rewrite of OpenSC build system. 2008-03-06 16:06:59 +00:00
compat_report_rangecheckfailure.c License clarification (#988) 2017-03-14 22:47:13 +01:00
compat_strlcat.c fixed checking for strlcat/strlcpy 2020-05-11 18:41:16 +02:00
compat_strlcat.h fixed checking for strlcat/strlcpy 2020-05-11 18:41:16 +02:00
compat_strlcpy.3 Complete rewrite of OpenSC build system. 2008-03-06 16:06:59 +00:00
compat_strlcpy.c fixed checking for strlcat/strlcpy 2020-05-11 18:41:16 +02:00
compat_strlcpy.h fixed checking for strlcat/strlcpy 2020-05-11 18:41:16 +02:00
compat_strnlen.c add compatibility implementation for strnlen 2016-01-20 10:47:27 +01:00
compat_strnlen.h added include guards to compatibility headers 2019-01-20 23:02:21 +01:00
libpkcs11.c use platform dependant implementation of erasing memory 2020-03-06 12:23:16 +01:00
libpkcs11.h added include guards 2019-05-02 10:08:28 +02:00
libscdl.c use _WIN32 instead of WIN32 2015-09-10 15:23:18 +02:00
libscdl.h Remove libltdl: Remove ltld references 2012-03-17 20:55:05 +01:00
simclist.c avoid redefinition of NDEBUG 2020-01-07 11:27:57 +01:00
simclist.h fixed minor XCode documentation warnings 2018-11-01 00:17:22 +01:00

README.compat_strlcpy

strncpy() is unsafe since it does not always add a final NUL-byte.
OpenBSD developed a safer version called strlcpy().

Use "man -l strlcpy.3" to read the manpage.

The files strlcpy.3 and strlcpy.c comes from
  ftp://ftp.openbsd.org/pub/OpenBSD/src/lib/libc/string/
and are Copyright (c) 1998, 2000 Todd C. Miller
<Todd.Miller@courtesan.com>