diff --git a/src/local_dc/local_dc_utils.h b/src/local_dc/local_dc_utils.h
index c6b81c76f67838985fb3a794a42423a9073b9222..2ee27cd505641c1a25264d40ddd9c55e17c2a364 100644
--- a/src/local_dc/local_dc_utils.h
+++ b/src/local_dc/local_dc_utils.h
@@ -47,12 +47,12 @@ extract_models_from_table( FILE* f, char* dest, int size )
         }
         cur = buffer;
         /* find the first space */
-        while ( *cur && *cur != ' ' )
+        while ( *cur && isspace( *cur ) )
         {
             ++cur;
         }
         /* move passed the space if we can */
-        if ( *cur == ' ' )
+        while ( isspace( *cur ) )
         {
             *cur = '\0';
             ++cur;