From: Kees van Reeuwijk Date: Mon, 22 Feb 2010 17:44:08 +0000 (+0000) Subject: Fix an array-bound violation, add some include guards. X-Git-Tag: v3.1.7~273 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/syslog.conf.5.html?a=commitdiff_plain;h=3922d457194f348afb38a495f42f29b8c974b1ff;p=minix.git Fix an array-bound violation, add some include guards. --- diff --git a/include/sys/types.h b/include/sys/types.h index 388f4371a..2795fc96b 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -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 #endif + +#endif diff --git a/servers/ds/inc.h b/servers/ds/inc.h index c0587c6bf..b8f3630da 100644 --- a/servers/ds/inc.h +++ b/servers/ds/inc.h @@ -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 #include "proto.h" - +#endif diff --git a/servers/ds/proto.h b/servers/ds/proto.h index 3bb3310df..211ec6b47 100644 --- a/servers/ds/proto.h +++ b/servers/ds/proto.h @@ -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 diff --git a/servers/ds/store.c b/servers/ds/store.c index e2d1c4aee..d80075171 100644 --- a/servers/ds/store.c +++ b/servers/ds/store.c @@ -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;