From 8caad6ed7cca1132162b51cd69fb3877e97b9a6d Mon Sep 17 00:00:00 2001 From: Cary R Date: Thu, 13 May 2010 18:27:41 -0700 Subject: [PATCH] Remove extra '\' in verinum as_string(). This is generating an octal constant but there is no reason to have three '\' characters. You need two to get the leading '\', but the last one is not needed. --- verinum.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/verinum.cc b/verinum.cc index 6bfcd0a98..9021daf79 100644 --- a/verinum.cc +++ b/verinum.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2009 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2010 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -514,14 +514,13 @@ string verinum::as_string() const if (char_val == '"' || char_val == '\\') { char tmp[5]; - snprintf(tmp, sizeof tmp, "\\\%03o", char_val); + snprintf(tmp, sizeof tmp, "\\%03o", char_val); res = res + tmp; } else if (char_val == ' ' || isgraph(char_val)) { res = res + char_val; - } else { char tmp[5]; - snprintf(tmp, sizeof tmp, "\\\%03o", char_val); + snprintf(tmp, sizeof tmp, "\\%03o", char_val); res = res + tmp; } }