Corydon posted this janitor project to the bug tracker and mvanbaak provided

a patch for it.  It replaces a bunch of simple calls to snprintf with ast_copy_string

(closes issue #10843)
Reported by: Corydon76
Patches: 
      2007092900_10843.diff uploaded by mvanbaak (license 7)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-10-01 15:23:19 +00:00
parent 9217a05b01
commit d78463be1e
14 changed files with 189 additions and 189 deletions

View File

@@ -229,7 +229,7 @@ static void dump_int(char *output, int maxlen, void *value, int len)
if (len == (int)sizeof(unsigned int))
snprintf(output, maxlen, "%lu", (unsigned long)ntohl(*((unsigned int *)value)));
else
snprintf(output, maxlen, "Invalid INT");
ast_copy_string(output, "Invalid INT", maxlen);
}
static void dump_short(char *output, int maxlen, void *value, int len)
@@ -237,7 +237,7 @@ static void dump_short(char *output, int maxlen, void *value, int len)
if (len == (int)sizeof(unsigned short))
snprintf(output, maxlen, "%d", ntohs(*((unsigned short *)value)));
else
snprintf(output, maxlen, "Invalid SHORT");
ast_copy_string(output, "Invalid SHORT", maxlen);
}
static void dump_byte(char *output, int maxlen, void *value, int len)
@@ -245,7 +245,7 @@ static void dump_byte(char *output, int maxlen, void *value, int len)
if (len == (int)sizeof(unsigned char))
snprintf(output, maxlen, "%d", *((unsigned char *)value));
else
snprintf(output, maxlen, "Invalid BYTE");
ast_copy_string(output, "Invalid BYTE", maxlen);
}
static char *proto2str(int proto, char *buf, int bufsiz)