Permalink
Browse files

fix truncated LOC parsing, closes #894

  • Loading branch information...
1 parent 1fcc7b7 commit 4eec51b6672dbb5c7cb0a07bbcbeae438d87d5b3 @Habbie Habbie committed Jul 3, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 pdns/sillyrecords.cc
@@ -76,7 +76,7 @@ latlon2ul(const char **latlonstrptr, int *which)
while (isspace(*cp))
cp++;
- if (!(isdigit(*cp)))
+ if (*cp && !(isdigit(*cp)))
goto fndhemi;
while (isdigit(*cp))
@@ -95,7 +95,7 @@ latlon2ul(const char **latlonstrptr, int *which)
}
}
- while (!isspace(*cp)) /* if any trailing garbage */
+ while (*cp && !isspace(*cp)) /* if any trailing garbage */
cp++;
while (isspace(*cp))
@@ -136,7 +136,7 @@ latlon2ul(const char **latlonstrptr, int *which)
cp++; /* skip the hemisphere */
- while (!isspace(*cp)) /* if any trailing garbage */
+ while (*cp && !isspace(*cp)) /* if any trailing garbage */
cp++;
while (isspace(*cp)) /* move to next field */

0 comments on commit 4eec51b

Please sign in to comment.