float_of_string sur chaine vide (PR#1662)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5539 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 2003-05-05 14:16:29 +00:00
parent ca2bda6887
commit 370a1cbdc4
1 changed files with 1 additions and 0 deletions

View File

@ -120,6 +120,7 @@ CAMLprim value float_of_string(value vs)
if (c != '_') *dst++ = c;
}
*dst = 0;
if (dst == buf) failwith("float_of_string");
d = strtod((const char *) buf, &end);
if (buf != parse_buffer) stat_free(buf);
if (end != dst) failwith("float_of_string");