- Changed strncpy to strlcpy, strncat to strlcat

- Added strlcpy and strlcat to SICS
- Added a driver for the POLDI power supplies


SKIPPED:
	psi/A1931.c
	psi/autowin.c
	psi/bruker.c
	psi/docho.c
	psi/dornier2.c
	psi/dspcode.c
	psi/ease.c
	psi/ecb.c
	psi/ecbcounter.c
	psi/ecbdriv.c
	psi/el734dc.c
	psi/el734driv.c
	psi/el734hp.c
	psi/el737driv.c
	psi/el737hpdriv.c
	psi/el737hpdrivsps.c
	psi/el737hpv2driv.c
	psi/el755driv.c
	psi/eurodriv.c
	psi/haakedriv.c
	psi/itc4driv.c
	psi/julcho.c
	psi/linadriv.c
	psi/lmd200.c
	psi/lscsupport.c
	psi/ltc11.c
	psi/make_gen
	psi/oicom.c
	psi/oxinst.c
	psi/pimotor.c
	psi/pipiezo.c
	psi/polterwrite.c
	psi/psi.c
	psi/sanscook.c
	psi/sanslirebin.c
	psi/sanswave.c
	psi/sinqhmdriv.c
	psi/sinqhttp.c
	psi/slsecho.c
	psi/slsmagnet.c
	psi/slsvme.c
	psi/sps.c
	psi/swmotor.c
	psi/swmotor2.c
	psi/tabledrive.c
	psi/tasscan.c
	psi/tdchm.c
	psi/velodorn.c
	psi/velodornier.c
This commit is contained in:
koennecke
2010-04-13 15:08:38 +00:00
parent d19e3e5ca9
commit b26b8fc735
83 changed files with 555 additions and 316 deletions

View File

@ -41,6 +41,8 @@
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <strlutil.h>
#include "fortify.h"
#include "lld.h"
#include "stringdict.h"
@ -167,7 +169,7 @@ int StringDictGet(pStringDict self, char *name, char *pResult, int iLen)
if (pResult == NULL) {
return strlen(sVal.value) + 1; /* for \0 */
} else {
strncpy(pResult, sVal.value, iLen);
strlcpy(pResult, sVal.value, iLen);
/* strncpy is not guaranteed to be '\0' terminated */
if (iLen > 0 && pResult[iLen - 1] != '\0') {
/* overflow */
@ -258,7 +260,7 @@ const char *StringDictGetNext(pStringDict self, char *pValue, int iValLen)
return NULL;
} else {
LLDnodeDataTo(self->iList, &sVal);
strncpy(pValue, sVal.value, iValLen);
strlcpy(pValue, sVal.value, iValLen);
/* strncpy is not guaranteed to be '\0' terminated */
if (iValLen > 0 && pValue[iValLen-1] != '\0') {
/* overflow */
@ -275,7 +277,7 @@ const char *StringDictGetNext(pStringDict self, char *pValue, int iValLen)
} else {
self->iTraverse = 1;
LLDnodeDataTo(self->iList, &sVal);
strncpy(pValue, sVal.value, iValLen);
strlcpy(pValue, sVal.value, iValLen);
/* strncpy is not guaranteed to be '\0' terminated */
if (iValLen > 0 && pValue[iValLen-1] != '\0') {
/* overflow */