diff src/utils.cc @ 13113:40f935b15a22

Fix warning about signed/unsigned comparison
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Wed, 07 Sep 2011 18:12:26 -0500
parents 7d4f5a033330
children 98d23b0f16e1
line wrap: on
line diff
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -1368,7 +1368,9 @@
 
       END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE;
 
-      if (nchars > -1 && nchars < size)
+      // Cast to avoid signed/unsigned comparison is safe due to
+      // short-circuiting
+      if (nchars > -1 && static_cast<size_t>(nchars) < size)
         break;
       else
         {