ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Convert-UUlib/uulib/fptools.c
(Generate patch)

Comparing Convert-UUlib/uulib/fptools.c (file contents):
Revision 1.14 by root, Fri Dec 11 20:27:00 2020 UTC vs.
Revision 1.15 by root, Fri Dec 11 21:59:30 2020 UTC

62 return TRUE; 62 return TRUE;
63} 63}
64#endif 64#endif
65#endif 65#endif
66 66
67char * fptools_id = "$Id: fptools.c,v 1.14 2020/12/11 20:27:00 root Exp $"; 67char * fptools_id = "$Id: fptools.c,v 1.15 2020/12/11 21:59:30 root Exp $";
68 68
69/* 69/*
70 * some versions of free can't handle a NULL pointer properly 70 * some versions of free can't handle a NULL pointer properly
71 * (ANSI says, free ignores a NULL pointer, but some machines 71 * (ANSI says, free ignores a NULL pointer, but some machines
72 * prefer to SIGSEGV on it) 72 * prefer to SIGSEGV on it)
176#endif 176#endif
177 177
178int TOOLEXPORT 178int TOOLEXPORT
179FP_strnicmp_fast (const char *str1, const char *str2, int count) 179FP_strnicmp_fast (const char *str1, const char *str2, int count)
180{ 180{
181 if (str1==NULL || str2==NULL) 181 if (!str1 || !str2)
182 return -1; 182 return -1;
183 183
184 while (*str1 && count) { 184 while (*str1 && count) {
185 if ((*str1 ^ *str2) & 0xdf) 185 if ((*str1 ^ *str2) & 0xdf)
186 break; 186 break;
280/* 280/*
281 * Nice fake of the real (non-standard) one 281 * Nice fake of the real (non-standard) one
282 */ 282 */
283 283
284char * TOOLEXPORT 284char * TOOLEXPORT
285FP_strrstr (char *ptr, char *str) 285FP_strrstr (const char *ptr, const char *str)
286{ 286{
287 char *found=NULL, *new, *iter=ptr; 287 const char *found=NULL, *new, *iter=ptr;
288 288
289 if (ptr==NULL || str==NULL) 289 if (ptr==NULL || str==NULL)
290 return NULL; 290 return NULL;
291 291
292 if (*str == '\0') 292 if (*str == '\0')
293 return ptr; 293 return (char *)ptr;
294 294
295 while ((new = FP_strstr (iter, str)) != NULL) { 295 while ((new = FP_strstr (iter, str)) != NULL) {
296 found = new; 296 found = new;
297 iter = new + 1; 297 iter = new + 1;
298 } 298 }
299
299 return found; 300 return (char *)found;
300} 301}
301 302
302char * TOOLEXPORT 303char * TOOLEXPORT
303FP_strirstr (char *ptr, char *str) 304FP_strirstr (char *ptr, char *str)
304{ 305{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines