From c76819d0a7f03c955cf6b8490d02022360c6dd99 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 7 Dec 2020 10:54:51 +0100 Subject: [PATCH] Check if a char is >0 before calling isdigit() because it asserts for negative numbers on windows. --- Stream_support/include/CGAL/IO/OFF/File_header_OFF_impl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Stream_support/include/CGAL/IO/OFF/File_header_OFF_impl.h b/Stream_support/include/CGAL/IO/OFF/File_header_OFF_impl.h index ab6b9ca0183..520e6abe76d 100644 --- a/Stream_support/include/CGAL/IO/OFF/File_header_OFF_impl.h +++ b/Stream_support/include/CGAL/IO/OFF/File_header_OFF_impl.h @@ -276,8 +276,8 @@ std::istream& operator>>( std::istream& in, File_header_OFF& h) { while( i < max_keyword - 1 && in.get(c) && std::isalnum(c)) keyword[i++] = c; keyword[i] = '\0'; - if ( i < 2 || (std::isdigit(keyword[0]) && keyword[0] != '4') - || std::isdigit(keyword[1])) { + if ( i < 2 || (keyword[0] >= 0 && std::isdigit(keyword[0]) && keyword[0] != '4') + || (keyword[1] >= 0 && std::isdigit(keyword[1]))) { in.clear( std::ios::badbit); if ( h.verbose()) { std::cerr << " " << std::endl; @@ -329,7 +329,7 @@ std::istream& operator>>( std::istream& in, File_header_OFF& h) { } } in >> skip_comment_OFF >> c; - if ( std::isdigit(c)) { + if (c >= 0 && std::isdigit(c)) { in.putback(c); int n; in >> n;