From: John Darrington Date: Sat, 11 May 2013 07:31:12 +0000 (+0200) Subject: Made _xml_char_to_int less prone to crashing X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fbuilds%2F20130511010510%2Fpspp;p=pspp Made _xml_char_to_int less prone to crashing --- diff --git a/src/data/spreadsheet-reader.h b/src/data/spreadsheet-reader.h index e9656ab12d..5e7eaa6e46 100644 --- a/src/data/spreadsheet-reader.h +++ b/src/data/spreadsheet-reader.h @@ -45,9 +45,9 @@ bool convert_cell_ref (const char *ref, int *coli, int *rowi); -#define _xml(X) (CHAR_CAST (const xmlChar *, X)) +#define _xml(X) (CHAR_CAST (const xmlChar *, (X))) -#define _xmlchar_to_int(X) (atoi(CHAR_CAST (const char *, X))) +#define _xmlchar_to_int(X) ((X) ? atoi (CHAR_CAST (const char *, (X))) : -1) enum spreadsheet_type {