summaryrefslogtreecommitdiff
path: root/ext/standard/metaphone.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-01-18 20:01:46 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-01-18 20:01:46 +0000
commit71e9f8cdd5e66d64335fb5f657ac3f801e517b90 (patch)
treed299de1756256af972412e7878a10e2282f94e26 /ext/standard/metaphone.c
parent60af5507a5586b8b476e85f92a87d4f8c48d399b (diff)
downloadphp-git-71e9f8cdd5e66d64335fb5f657ac3f801e517b90.tar.gz
Removed pointless memory allocation checks.
Diffstat (limited to 'ext/standard/metaphone.c')
-rw-r--r--ext/standard/metaphone.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c
index e6cc2cf67f..10e3396edf 100644
--- a/ext/standard/metaphone.c
+++ b/ext/standard/metaphone.c
@@ -145,9 +145,7 @@ static char Lookahead(char *word, int how_far)
* could be one though; or more too). */
#define Phonize(c) { \
if (p_idx >= max_buffer_len) { \
- if (NULL == (*phoned_word = erealloc(*phoned_word, max_buffer_len + 2))) { \
- return -1; \
- } \
+ *phoned_word = erealloc(*phoned_word, max_buffer_len + 2); \
max_buffer_len += 2; \
} \
(*phoned_word)[p_idx++] = c; \
@@ -185,13 +183,9 @@ static int metaphone(char *word, int word_len, int max_phonemes, char **phoned_w
if (max_phonemes == 0) { /* Assume largest possible */
max_buffer_len = word_len;
*phoned_word = emalloc(sizeof(char) * word_len + 1);
- if (!*phoned_word)
- return -1;
} else {
max_buffer_len = max_phonemes;
*phoned_word = emalloc(sizeof(char) * max_phonemes + 1);
- if (!*phoned_word)
- return -1;
}