{
char *res;
- if (**ptr == 0) {
- return NULL;
- }
+ if (**ptr == '\0') return NULL;
- while (**ptr && strchr(sep, **ptr)) {
- (*ptr)++;
- }
- if (**ptr == 0) {
- return NULL;
- }
+ while (**ptr && strchr(sep, **ptr)) (*ptr)++;
+
+ if (**ptr == '\0') return NULL;
res = *ptr;
- while (**ptr && strchr(sep, **ptr) == NULL) {
- (*ptr)++;
- }
+ while (**ptr && strchr(sep, **ptr) == NULL) (*ptr)++;
+
+ if (**ptr != '\0') *(*ptr)++ = '\0';
- if (**ptr != 0) {
- *(*ptr)++ = 0;
- }
return res;
}
*
* Otherwise, ignore errors and assume GMT.
*/
- if (p) {
+ if (*p != '\0') {
fr_skip_whitespace(p);
(void) fr_time_delta_from_time_zone(p, &gmtoff);
}