Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Fixup maybe_read_hex_byte() based on results of testing.
Matthew Seaman committed 13 years ago
commit 3f9798419701d7115932c8cff0718a507728f40b
parent e9fd71db9bf9e04505132f3550f5e7f1c73cdaaf
1 file changed +3 -1
modified libpkg/pkg_printf.c
@@ -1724,6 +1724,8 @@ maybe_read_hex_byte(struct sbuf *sbuf, const char *f)

	/* Hex escapes are of the form \xNN -- always two hex digits */

+
	f++;			/* eat the x */
+

	if (isxdigit(f[0]) && isxdigit(f[1])) {
		switch(*f) {
		case '0':
@@ -1842,6 +1844,7 @@ maybe_read_hex_byte(struct sbuf *sbuf, const char *f)
		}

		sbuf_putc(sbuf, val);
+
		f++;
	} else {
		/* Pass through unchanged if it's not a recognizable
		   hex byte. */
@@ -1933,7 +1936,6 @@ process_escape(struct sbuf *sbuf, const char *f)
		sbuf_putc(sbuf, '\\');
		break;
	case 'x':		/* Hex escape: \xNN */
-
		f++;
		f = maybe_read_hex_byte(sbuf, f);
		break;
	case '0':