various coverity-inspired fixes

. some strncpy/strcpy to strlcpy conversions
	. new <minix/param.h> to avoid including other minix headers
	  that have colliding definitions with library and commands code,
	  causing parse warnings
	. removed some dead code / assignments
This commit is contained in:
Ben Gras
2012-07-16 13:17:11 +02:00
parent 77dbd766c1
commit cbcdb838f1
26 changed files with 89 additions and 80 deletions

View File

@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <env.h>
#include <string.h>
#include <minix/param.h>
/*=========================================================================*
@@ -98,9 +99,9 @@ struct memory *mem_chunks; /* where to store the memory bits */
int maxchunks; /* how many were found */
{
static kinfo_t kinfo;
int mm;
int mm, r;
sys_getkinfo(&kinfo);
if((r=sys_getkinfo(&kinfo)) != OK) return r;
/* Initialize everything to zero. */
memset(mem_chunks, 0, maxchunks*sizeof(*mem_chunks));