* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.264 2005-12-13 13:44:29 hannes Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.265 2006-02-08 01:38:17 hannes Exp $ (LBL)
*/
#ifndef tcpdump_interface_h
extern char *copy_argv(char **);
extern void safeputchar(int);
-extern void safeputs(const char *);
+extern void safeputs(const char *, int);
extern const char *isonsap_string(const u_char *, register u_int);
extern const char *protoid_string(const u_char *);
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.20 2005-10-20 07:43:51 hannes Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.21 2006-02-08 01:38:17 hannes Exp $ (LBL)
*/
#ifndef netdissect_h
#endif
extern void safeputchar(int);
-extern void safeputs(const char *);
+extern void safeputs(const char *, int);
#if 0
extern const char *isonsap_string(netdissect_options *, const u_char *);
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.105 2006-01-22 19:06:37 gianluca Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.106 2006-02-08 01:38:16 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
}
void
-safeputs(const char *s)
+safeputs(const char *s, int maxlen)
{
- while (*s) {
+ int idx = 0;
+ while (*s && idx < maxlen) {
safeputchar(*s);
+ idx++;
s++;
}
}
if (ch < 0x80 && isprint(ch))
printf("%c", ch);
else
- printf("\\%03o", ch);
+ printf("\\0x%02x ", ch);
}