more braces

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5226 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1998-11-22 09:45:42 +00:00
parent 356a835d28
commit 66b3034e8e
5 changed files with 13 additions and 7 deletions

View File

@@ -169,11 +169,12 @@ otp_parse_hex (OtpKey key, char *s)
b = buf; b = buf;
while (*s) { while (*s) {
if (strchr ("0123456789ABCDEFabcdef", *s)) if (strchr ("0123456789ABCDEFabcdef", *s)) {
if (b - buf >= 16) if (b - buf >= 16)
return -1; return -1;
else else
*b++ = tolower(*s); *b++ = tolower(*s);
}
s++; s++;
} }
*b = '\0'; *b = '\0';

View File

@@ -338,11 +338,12 @@ arg_match_long(struct getargs *args, size_t num_args,
break; break;
} }
} }
if (current == NULL) if (current == NULL) {
if (partial_match == 1) if (partial_match == 1)
current = partial; current = partial;
else else
return ARG_ERR_NO_MATCH; return ARG_ERR_NO_MATCH;
}
if(*optarg == '\0' && !ISFLAG(*current)) if(*optarg == '\0' && !ISFLAG(*current))
return ARG_ERR_NO_MATCH; return ARG_ERR_NO_MATCH;

View File

@@ -64,13 +64,14 @@ net_read (int fd, void *buf, size_t nbytes)
#else #else
count = read (fd, cbuf, rem); count = read (fd, cbuf, rem);
#endif #endif
if (count < 0) if (count < 0) {
if (errno == EINTR) if (errno == EINTR)
continue; continue;
else else
return count; return count;
else if (count == 0) } else if (count == 0) {
return count; return count;
}
cbuf += count; cbuf += count;
rem -= count; rem -= count;
} }

View File

@@ -64,11 +64,12 @@ net_write (int fd, const void *buf, size_t nbytes)
#else #else
count = write (fd, cbuf, rem); count = write (fd, cbuf, rem);
#endif #endif
if (count < 0) if (count < 0) {
if (errno == EINTR) if (errno == EINTR)
continue; continue;
else else
return count; return count;
}
cbuf += count; cbuf += count;
rem -= count; rem -= count;
} }

View File

@@ -88,11 +88,12 @@ parse_something (const char *s, const struct units *units,
++p; ++p;
val = strtod (p, &next); /* strtol(p, &next, 0); */ val = strtod (p, &next); /* strtol(p, &next, 0); */
if (val == 0 && p == next) if (val == 0 && p == next) {
if(accept_no_val_p) if(accept_no_val_p)
val = 1; val = 1;
else else
return -1; return -1;
}
p = next; p = next;
while (isspace(*p)) while (isspace(*p))
++p; ++p;
@@ -126,7 +127,7 @@ parse_something (const char *s, const struct units *units,
} }
} }
} }
if (u->name == NULL) if (u->name == NULL) {
if (partial == 1) { if (partial == 1) {
p += u_len; p += u_len;
res = (*func)(res, val, partial_unit->mult); res = (*func)(res, val, partial_unit->mult);
@@ -135,6 +136,7 @@ parse_something (const char *s, const struct units *units,
} else { } else {
return -1; return -1;
} }
}
if (*p == 's') if (*p == 's')
++p; ++p;
} }