- 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

@@ -1064,7 +1064,7 @@ static hdbCallbackReturn MemGenSetCallback(pHdb node, void *userData,
memcpy(userData, &mm->v->v.doubleValue, sizeof(double));
break;
case HIPTEXT:
strncpy((char *) userData, (const char *) mm->v->v.text,
strlcpy((char *) userData, (const char *) mm->v->v.text,
node->value.arrayLength);
break;
case HIPINTAR:
@@ -1555,7 +1555,11 @@ pHdb FindHdbNode(char *rootpath, char *relpath, SConnection * pCon)
return FindHdbParent(rootpath, relpath, NULL, pCon);
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------
* This does not use strlcpy, strlcat on purpose: it caused a bug
* There are so many length checks in the code anyway so that is
* not necessary either.
--------------------------------------------------------------------------*/
int GetHdbPath(pHdb nodeArg, char *path, size_t pathlen)
{
pHdb node, parent;
@@ -1882,9 +1886,9 @@ void PrintSICSParList(pHdb node, SConnection * pCon, char *prefix)
}
}
if (child->child != NULL) {
strncpy(childPrefix, prefix, 1024);
strncat(childPrefix, child->name, 1024);
strncat(childPrefix, "/", 1024);
strlcpy(childPrefix, prefix, 1024);
strlcat(childPrefix, child->name, 1024);
strlcat(childPrefix, "/", 1024);
PrintSICSParList(child, pCon, prefix);
}
child = child->next;
@@ -2432,7 +2436,7 @@ static int ZipGetHdbNode(SConnection * pCon, SicsInterp * pSics,
return 0;
}
strncpy(oriPath, argv[1], 511);
strlcpy(oriPath, argv[1], 511);
targetNode = FindHdbNode(NULL, argv[1], pCon);
if (targetNode == NULL) {
return 0;
@@ -2467,7 +2471,7 @@ static int GetHdbNode(SConnection * pCon, SicsInterp * pSics, void *pData,
return 0;
}
strncpy(oriPath, argv[1], 511);
strlcpy(oriPath, argv[1], 511);
targetNode = FindHdbNode(NULL, argv[1], pCon);
if (targetNode == NULL) {
return 0;
@@ -2519,7 +2523,7 @@ static int GetHdbVal(SConnection * pCon, SicsInterp * pSics, void *pData,
return 0;
}
strncpy(oriPath, argv[1], 511);
strlcpy(oriPath, argv[1], 511);
targetNode = FindHdbNode(NULL, argv[1], pCon);
if (targetNode == NULL) {
return 0;
@@ -2570,7 +2574,7 @@ static int HdbNodeInfo(SConnection * pCon, SicsInterp * pSics, void *pData,
return 0;
}
strncpy(oriPath, argv[1], 511);
strlcpy(oriPath, argv[1], 511);
targetNode = FindHdbNode(NULL, argv[1], pCon);
if (targetNode == NULL) {
return 0;