Fix an array-bound violation, add some include guards.

This commit is contained in:
Kees van Reeuwijk 2010-02-22 17:44:08 +00:00
parent c460974814
commit 3922d45719
4 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,6 @@
#ifndef _INC_SYS_TYPE_H
#define _INC_SYS_TYPE_H
/*
* this files resolves conflicts between the file of the host system and
* the minix specific one. This file is included directly only on Minix
@ -9,3 +12,5 @@
#else
#include <minix/types.h>
#endif
#endif

View file

@ -1,3 +1,6 @@
#ifndef _INC_INC_H
#define _INC_INC_H
/* Header file including all needed system headers. */
#define _SYSTEM 1 /* get OK and negative error codes */
@ -28,4 +31,4 @@
#include <signal.h>
#include "proto.h"
#endif

View file

@ -1,3 +1,6 @@
#ifndef _INC_PROTO_H
#define _INC_PROTO_H
/* Function prototypes. */
/* main.c */
@ -14,3 +17,4 @@ _PROTOTYPE(int do_snapshot, (message *m_ptr));
_PROTOTYPE(int do_getsysinfo, (message *m_ptr));
_PROTOTYPE(int sef_cb_init_fresh, (int type, sef_init_info_t *info));
#endif

View file

@ -325,7 +325,7 @@ PUBLIC int do_publish(message *m_ptr)
break;
case DSF_TYPE_STR:
strncpy(dsp->u.string, (char *)(&m_ptr->DS_STRING), DS_MAX_STRLEN);
dsp->u.string[DS_MAX_KEYLEN - 1] = '\0';
dsp->u.string[DS_MAX_STRLEN - 1] = '\0';
break;
case DSF_TYPE_MEM:
length = m_ptr->DS_VAL_LEN;