Module Name: src Committed By: plunky Date: Thu Sep 15 17:52:53 UTC 2011
Modified Files: src/usr.bin/sdpquery: print.c Log Message: when printing URL strings, don't use VIS_HTTPSTYLE, it does not quite work as I expected.. just use VIS_CSTYLE To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/usr.bin/sdpquery/print.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/sdpquery/print.c diff -u src/usr.bin/sdpquery/print.c:1.18 src/usr.bin/sdpquery/print.c:1.19 --- src/usr.bin/sdpquery/print.c:1.18 Sat Aug 20 09:18:47 2011 +++ src/usr.bin/sdpquery/print.c Thu Sep 15 17:52:53 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: print.c,v 1.18 2011/08/20 09:18:47 plunky Exp $ */ +/* $NetBSD: print.c,v 1.19 2011/09/15 17:52:53 plunky Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: print.c,v 1.18 2011/08/20 09:18:47 plunky Exp $"); +__RCSID("$NetBSD: print.c,v 1.19 2011/09/15 17:52:53 plunky Exp $"); #include <ctype.h> #include <iconv.h> @@ -64,7 +64,7 @@ } language_t; static const char *string_uuid(uuid_t *); -static const char *string_vis(int, const char *, size_t); +static const char *string_vis(const char *, size_t); static void print_hexdump(const char *, const uint8_t *, size_t); static bool print_attribute(uint16_t, sdp_data_t *, attr_t *, size_t); @@ -553,13 +553,14 @@ } static const char * -string_vis(int style, const char *src, size_t len) +string_vis(const char *src, size_t len) { static char buf[50]; char *dst = buf; + int style; buf[0] = '\0'; - style |= VIS_NL; + style = VIS_CSTYLE | VIS_NL; while (len > 0 && (dst + 5) < (buf + sizeof(buf))) { dst = vis(dst, src[0], style, (len > 1 ? src[1] : 0)); src++; @@ -776,7 +777,7 @@ if (!sdp_get_str(data, &str, &len)) return; - printf("\"%s\"\n", string_vis(VIS_CSTYLE, str, len)); + printf("\"%s\"\n", string_vis(str, len)); } static void @@ -799,7 +800,7 @@ len -= l + 1; ep++; } - printf(" %s\n", string_vis(VIS_CSTYLE, str, l)); + printf(" %s\n", string_vis(str, l)); str = ep; } } @@ -813,7 +814,7 @@ if (!sdp_get_url(data, &url, &len)) return; - printf("\"%s\"\n", string_vis(VIS_HTTPSTYLE, url, len)); + printf("\"%s\"\n", string_vis(url, len)); } static void @@ -1608,7 +1609,7 @@ } l = (size_t)(ep - str + 1); - printf(" %s\n", string_vis(VIS_CSTYLE, str, l)); + printf(" %s\n", string_vis(str, l)); str += l; len -= l; }