diff options
| author | Sascha Schumann <sas@php.net> | 1999-11-26 16:51:57 +0000 |
|---|---|---|
| committer | Sascha Schumann <sas@php.net> | 1999-11-26 16:51:57 +0000 |
| commit | 2f6ded9ac9bb8826eb9b3b79b8cdc018c90aff54 (patch) | |
| tree | c47d480cc160fad7842ebee9ee96672e57e54628 /ext/filepro/filepro.c | |
| parent | fe48f6ed6aff5572fbb2c093690ecf9b24248b86 (diff) | |
| download | php-git-2f6ded9ac9bb8826eb9b3b79b8cdc018c90aff54.tar.gz | |
Convert more source files to use thread-safe functions
Diffstat (limited to 'ext/filepro/filepro.c')
| -rw-r--r-- | ext/filepro/filepro.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ext/filepro/filepro.c b/ext/filepro/filepro.c index 83a63e8f3e..a9b7ec3064 100644 --- a/ext/filepro/filepro.c +++ b/ext/filepro/filepro.c @@ -182,6 +182,7 @@ PHP_FUNCTION(filepro) FILE *fp; char workbuf[256]; /* FIX - should really be the max filename length */ char readbuf[256]; + char *strtok_buf = NULL; int i; FP_FIELD *new_field, *tmp; FP_TLS_VARS; @@ -221,13 +222,13 @@ PHP_FUNCTION(filepro) } /* Get the field count, assume the file is readable! */ - if (strcmp(strtok(readbuf, ":"), "map")) { + if (strcmp(strtok_r(readbuf, ":", &strtok_buf), "map")) { php_error(E_WARNING, "filePro: map file corrupt or encrypted"); RETURN_FALSE; } - FP_GLOBAL(fp_keysize) = atoi(strtok(NULL, ":")); - strtok(NULL, ":"); - FP_GLOBAL(fp_fcount) = atoi(strtok(NULL, ":")); + FP_GLOBAL(fp_keysize) = atoi(strtok_r(NULL, ":", &strtok_buf)); + strtok_r(NULL, ":", &strtok_buf); + FP_GLOBAL(fp_fcount) = atoi(strtok_r(NULL, ":", &strtok_buf)); /* Read in the fields themselves */ for (i = 0; i < FP_GLOBAL(fp_fcount); i++) { @@ -239,9 +240,9 @@ PHP_FUNCTION(filepro) } new_field = emalloc(sizeof(FP_FIELD)); new_field->next = NULL; - new_field->name = estrdup(strtok(readbuf, ":")); - new_field->width = atoi(strtok(NULL, ":")); - new_field->format = estrdup(strtok(NULL, ":")); + new_field->name = estrdup(strtok_r(readbuf, ":", &strtok_buf)); + new_field->width = atoi(strtok_r(NULL, ":", &strtok_buf)); + new_field->format = estrdup(strtok_r(NULL, ":", &strtok_buf)); /* Store in forward-order to save time later */ if (!FP_GLOBAL(fp_fieldlist)) { |
