make sure snprintf() buffer is terminated
This commit is contained in:
parent
6432d714cc
commit
1c1559f36c
1 changed files with 2 additions and 0 deletions
|
@ -463,6 +463,7 @@ getLongitudeString ()
|
|||
snprintf(buf, 32, "%d*%02d %04.1f%c", int(d < 0.0 ? -deg : deg),
|
||||
int(min), fabs(sec), c);
|
||||
}
|
||||
buf[31] = '\0';
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
@ -491,6 +492,7 @@ getLatitudeString ()
|
|||
snprintf(buf, 32, "%d*%02d %04.1f%c", int(d < 0.0 ? -deg : deg),
|
||||
int(min), fabs(sec), c);
|
||||
}
|
||||
buf[31] = '\0';
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue