Replace calls to strtok() with strtok_r()

strtok() uses a static buffer, making it not thread safe.

Also add a #define to cause a compile failure if strtok is used.

Change-Id: Icce265153e1e65adafa8849334438ab6d190e541
This commit is contained in:
Sean Bright
2019-03-06 16:04:57 -05:00
parent a32f525489
commit 2473b791b9
4 changed files with 19 additions and 13 deletions

View File

@@ -47,6 +47,7 @@
#define DEFAULT_SAMPLES_PER_MS ((DEFAULT_SAMPLE_RATE)/1000)
#define setpriority __PLEASE_USE_ast_set_priority_INSTEAD_OF_setpriority__
#define sched_setscheduler __PLEASE_USE_ast_set_priority_INSTEAD_OF_sched_setscheduler__
#define strtok __PLEASE_USE_strtok_r_INSTEAD_OF_strtok__
#if defined(DEBUG_FD_LEAKS) && !defined(STANDALONE) && !defined(STANDALONE2) && !defined(STANDALONE_AEL)
/* These includes are all about ordering */