summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/openocd.c2
-rw-r--r--src/server/gdb_server.c16
-rw-r--r--src/target/arm_disassembler.c4
3 files changed, 13 insertions, 9 deletions
diff --git a/src/openocd.c b/src/openocd.c
index 229fd916..b8392911 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -18,7 +18,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#define OPENOCD_VERSION "Open On-Chip Debugger (2006-06-25 13:15 CEST)"
+#define OPENOCD_VERSION "Open On-Chip Debugger (2006-06-25 22:45 CEST)"
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index e8664bb2..b0c09961 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -32,14 +32,18 @@
#include <unistd.h>
#include <stdlib.h>
-// -ino: 060521-1116
#ifndef HAVE_STRNDUP
#include <stdio.h>
-char * strndup(char * str, int n) {
- unsigned char * tmp = malloc((size_t)n+1);
- if (! tmp) perror("gdb_server malloc failed");
- if (strlcpy(tmp, str, n) > n) perror("gdb_server strndup: too long");
- return tmp;
+char* strndup(const char *s, size_t n)
+{
+ size_t len = strnlen (s, n);
+ char *new = (char *) malloc (len + 1);
+
+ if (new == NULL)
+ return NULL;
+
+ new[len] = '\0';
+ return (char *) memcpy (new, s, len);
}
#endif
diff --git a/src/target/arm_disassembler.c b/src/target/arm_disassembler.c
index 04dcf4ba..3a9c1f87 100644
--- a/src/target/arm_disassembler.c
+++ b/src/target/arm_disassembler.c
@@ -21,7 +21,7 @@
#include "log.h"
-#include <strings.h>
+#include <string.h>
/* textual represenation of the condition field */
/* ALways (default) is ommitted (empty string) */
@@ -1158,7 +1158,7 @@ int evaluate_data_proc(u32 opcode, u32 address, arm_instruction_t *instruction)
int evaluate_opcode(u32 opcode, u32 address, arm_instruction_t *instruction)
{
/* clear fields, to avoid confusion */
- bzero(instruction, sizeof(arm_instruction_t));
+ memset(instruction, 0, sizeof(arm_instruction_t));
instruction->opcode = opcode;
/* catch opcodes with condition field [31:28] = b1111 */