Closed cycloid closed 8 years ago
The code itself might be fine. It seems just to use strtok_r() correctly. I have no experience to use strtok_r() on MacOSX. Please check the strtok_r() implementation on MacOSX.
On MacOS X the strtok_r() function requires POSIX C language level of at least 199506.
In /usr/include/string.h:
/* Additional functionality provided by:
* POSIX.1c-1995,
* POSIX.1i-1995,
* and the omnibus ISO/IEC 9945-1: 1996
*/
#if __DARWIN_C_LEVEL >= 199506L
__BEGIN_DECLS
char *strtok_r(char *, const char *, char **);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 199506L */
Changing line 106 of rtkcmn.c to:
#define _POSIX_C_SOURCE 199506
fixes this bug. I couldn't find any indications of whether the explicit POSIX language level required for rtkcmn.c was a minimum or maximum version constraint, so I can't say whether this breaks anything else. The file compiles cleanly on MacOS 10.8.5 and Debian 3.2.54.
Thanks. It is fixed in rtklib 2.4.3 b17.
When compiled for MacOS 10.8.5, convbin segfaults in routine expath() [rtkcmn.c:2945]
This bug first appeared after the rtklib_4.2.2_p10 commit.