Fixed 'String too large' error in command-line tool.
authorFlorian Pose <fp@igh-essen.com>
Tue, 10 Apr 2012 18:56:50 +0200
changeset 2388 7fc286c8e72b
parent 2387 bed7bd7588d0
child 2389 02f32b78f79d
Fixed 'String too large' error in command-line tool.
tool/DataTypeHandler.cpp
--- a/tool/DataTypeHandler.cpp	Fri Jul 13 13:46:58 2012 +0200
+++ b/tool/DataTypeHandler.cpp	Tue Apr 10 18:56:50 2012 +0200
@@ -1,6 +1,6 @@
 /*****************************************************************************
  *
- *  $Id$
+ *  $Id: DataTypeHandler.cpp,v 08f547145c91 2012/01/04 14:57:10 fp $
  *
  *  Copyright (C) 2006-2009  Florian Pose, Ingenieurgemeinschaft IgH
  *
@@ -186,9 +186,10 @@
         case 0x000a: // octet_string
         case 0x000b: // unicode_string
             dataSize = str.str().size();
-            if (dataSize >= targetSize) {
+            if (dataSize > targetSize) {
                 stringstream err;
-                err << "String too large";
+                err << "String too large ("
+                    << dataSize << " > " << targetSize << ")";
                 throw SizeException(err.str());
             }
             str >> (char *) target;