]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix debug not showing some values.
authoramosjeffries <>
Fri, 24 Aug 2007 07:02:09 +0000 (07:02 +0000)
committeramosjeffries <>
Fri, 24 Aug 2007 07:02:09 +0000 (07:02 +0000)
debugs() does not handle uint8_t properly if the value is 0-31, 127+.
This patch adds a proper stream operator to display them like any other int

src/Debug.h

index 1753c41206dded1dd4c190f456ef6a09bbff3e87..64a64bca4d2dd90af5a7e166c70e980a55b7865e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: Debug.h,v 1.9 2007/04/28 22:26:37 hno Exp $
+ * $Id: Debug.h,v 1.10 2007/08/24 01:02:09 amosjeffries Exp $
  *
  * DEBUG: section 0     Debug Routines
  * AUTHOR: Harvest Derived
@@ -83,4 +83,9 @@ private:
  */
 #define HERE __FILE__<<"("<<__LINE__<<") "
 
+/* AYJ: some uint8_t do not like streaming control-chars (values 0-31, 127+) */
+inline std::ostream& operator <<(std::ostream &os, const uint8_t d) {
+    return (os << (int)d);
+}
+
 #endif /* SQUID_DEBUG */