Fix snprintf fallout

This commit is contained in:
martin 2014-04-03 17:02:34 +00:00
parent aabb413a06
commit 6094f903f1
2 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: disasm.h,v 1.1 2006/04/07 14:21:18 cherry Exp $ */
/* $NetBSD: disasm.h,v 1.2 2014/04/03 17:02:34 martin Exp $ */
/*-
* Copyright (c) 2000-2003 Marcel Moolenaar
@ -316,9 +316,9 @@ int asm_extract(enum asm_op, enum asm_fmt, uint64_t, struct asm_bundle *, int);
int asm_decode(uint64_t, struct asm_bundle *);
void asm_completer(const struct asm_cmpltr *, char *);
void asm_mnemonic(const enum asm_op, char *);
void asm_operand(const struct asm_oper *, char *, uint64_t);
void asm_completer(const struct asm_cmpltr *, char *, size_t);
void asm_mnemonic(const enum asm_op, char *, size_t);
void asm_operand(const struct asm_oper *, char *, size_t, uint64_t);
void asm_print_bundle(const struct asm_bundle *, uint64_t);
void asm_print_inst(const struct asm_bundle *, int, uint64_t);

View File

@ -1,4 +1,4 @@
/* $NetBSD: disasm_format.c,v 1.3 2014/03/27 18:22:56 christos Exp $ */
/* $NetBSD: disasm_format.c,v 1.4 2014/04/03 17:02:34 martin Exp $ */
/*-
* Copyright (c) 2000-2003 Marcel Moolenaar
@ -287,7 +287,7 @@ asm_operand(const struct asm_oper *o, char *buf, size_t buflen, uint64_t ip)
case 12: l = strlcpy(buf, "sp", buflen); break;
case 13: l = strlcpy(buf, "tp", buflen); break;
default:
l += snprintf(buf, buflen, "r%d", (int)o->o_value);
l = snprintf(buf, buflen, "r%d", (int)o->o_value);
if (l > buflen)
l = buflen;
break;