From 51a35423cbcbe7c43e4c91e5322bfc7b82b1977c Mon Sep 17 00:00:00 2001 From: krw Date: Sun, 9 Jul 2017 19:19:58 +0000 Subject: [PATCH] Be consistent. "return (e);" -> "return e;" --- sbin/dhclient/bpf.c | 10 ++--- sbin/dhclient/conflex.c | 20 +++++----- sbin/dhclient/dhclient.c | 86 ++++++++++++++++++++-------------------- sbin/dhclient/kroute.c | 26 ++++++------ sbin/dhclient/options.c | 48 +++++++++++----------- sbin/dhclient/packet.c | 28 ++++++------- sbin/dhclient/parse.c | 52 ++++++++++++------------ 7 files changed, 135 insertions(+), 135 deletions(-) diff --git a/sbin/dhclient/bpf.c b/sbin/dhclient/bpf.c index ae49ac84fd2..21e6ba981ec 100644 --- a/sbin/dhclient/bpf.c +++ b/sbin/dhclient/bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.c,v 1.57 2017/07/08 00:36:10 krw Exp $ */ +/* $OpenBSD: bpf.c,v 1.58 2017/07/09 19:19:58 krw Exp $ */ /* BPF socket interface code, originally contributed by Archie Cobbs. */ @@ -324,7 +324,7 @@ send_packet(struct interface_info *ifi, struct in_addr from, struct in_addr to) if (result == -1) log_warn("send_packet"); - return (result); + return result ; } ssize_t @@ -350,7 +350,7 @@ receive_packet(struct interface_info *ifi, struct sockaddr_in *from, if (ifi->rbuf_offset >= ifi->rbuf_len) { length = read(ifi->bfdesc, ifi->rbuf, ifi->rbuf_max); if (length <= 0) - return (length); + return length ; ifi->rbuf_offset = 0; ifi->rbuf_len = length; } @@ -439,7 +439,7 @@ receive_packet(struct interface_info *ifi, struct sockaddr_in *from, memcpy(packet, ifi->rbuf + ifi->rbuf_offset, hdr.bh_caplen); ifi->rbuf_offset = BPF_WORDALIGN(ifi->rbuf_offset + hdr.bh_caplen); - return (hdr.bh_caplen); + return hdr.bh_caplen ; } while (!length); - return (0); + return 0 ; } diff --git a/sbin/dhclient/conflex.c b/sbin/dhclient/conflex.c index cc636334ff8..a9d0dcdcdd6 100644 --- a/sbin/dhclient/conflex.c +++ b/sbin/dhclient/conflex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conflex.c,v 1.40 2017/06/29 21:37:43 krw Exp $ */ +/* $OpenBSD: conflex.c,v 1.41 2017/07/09 19:19:58 krw Exp $ */ /* Lexical scanner for dhclient config file. */ @@ -134,7 +134,7 @@ get_char(FILE *cfile) } } else ugflag = 0; - return (c); + return c; } static int @@ -175,7 +175,7 @@ get_token(FILE *cfile) break; } } while (1); - return (ttok); + return ttok; } int @@ -197,7 +197,7 @@ next_token(char **rval, FILE *cfile) if (rval) *rval = tval; - return (rv); + return rv; } int @@ -221,7 +221,7 @@ peek_token(char **rval, FILE *cfile) if (rval) *rval = tval; - return (token); + return token; } static void @@ -271,7 +271,7 @@ read_string(FILE *cfile) tokbuf[i] = '\0'; tval = tokbuf; - return (TOK_STRING); + return TOK_STRING; } static int @@ -314,7 +314,7 @@ read_num_or_name(int c, FILE *cfile) if (rv == TOK_NUMBER_OR_NAME && xdigits != i) rv = TOK_NAME; - return (rv); + return rv; } static const struct keywords { @@ -357,7 +357,7 @@ int kw_cmp(const void *k, const void *e); int kw_cmp(const void *k, const void *e) { - return (strcasecmp(k, ((const struct keywords *)e)->k_name)); + return strcasecmp(k, ((const struct keywords *)e)->k_name); } static int @@ -368,6 +368,6 @@ intern(char *atom, int dfv) p = bsearch(atom, keywords, sizeof(keywords)/sizeof(keywords[0]), sizeof(keywords[0]), kw_cmp); if (p) - return (p->k_val); - return (dfv); + return p->k_val; + return dfv; } diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index a432917f5c3..48e5e44f464 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.462 2017/07/09 12:38:47 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.463 2017/07/09 19:19:58 krw Exp $ */ /* * Copyright 2004 Henning Brauer @@ -199,7 +199,7 @@ findproto(char *cp, int n) ADVANCE(cp, sa); } } - return (-1); + return -1; } struct sockaddr * @@ -209,16 +209,16 @@ get_ifa(char *cp, int n) unsigned int i; if (n == 0) - return (NULL); + return NULL; for (i = 1; i; i <<= 1) if (i & n) { sa = (struct sockaddr *)cp; if (i == RTA_IFA) - return (sa); + return sa; ADVANCE(cp, sa); } - return (NULL); + return NULL; } void @@ -681,7 +681,7 @@ main(int argc, char *argv[]) dispatch(ifi, routefd); /* not reached */ - return (0); + return 0; } void @@ -1153,7 +1153,7 @@ addressinuse(char *name, struct in_addr address, char *ifname) if (getifaddrs(&ifap) != 0) { log_warn("addressinuse: getifaddrs"); - return (0); + return 0; } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { @@ -1171,7 +1171,7 @@ addressinuse(char *name, struct in_addr address, char *ifname) } freeifaddrs(ifap); - return (used); + return used; } /* @@ -1847,7 +1847,7 @@ lease_as_string(char *ifname, char *type, struct client_lease *lease) buf = pretty_print_string(ifname, strlen(ifname), 1); if (buf == NULL) - return (NULL); + return NULL; append_statement(string, sizeof(string), " interface ", buf); append_statement(string, sizeof(string), " fixed-address ", @@ -1859,21 +1859,21 @@ lease_as_string(char *ifname, char *type, struct client_lease *lease) buf = pretty_print_string(lease->filename, strlen(lease->filename), 1); if (buf == NULL) - return (NULL); + return NULL; append_statement(string, sizeof(string), " filename ", buf); } if (lease->server_name) { buf = pretty_print_string(lease->server_name, strlen(lease->server_name), 1); if (buf == NULL) - return (NULL); + return NULL; append_statement(string, sizeof(string), " server-name ", buf); } if (lease->ssid_len != 0) { buf = pretty_print_string(lease->ssid, lease->ssid_len, 1); if (buf == NULL) - return (NULL); + return NULL; append_statement(string, sizeof(string), " ssid ", buf); } @@ -1885,7 +1885,7 @@ lease_as_string(char *ifname, char *type, struct client_lease *lease) buf = pretty_print_option(i, opt, 1); if (buf == NULL) - return (NULL); + return NULL; strlcat(string, " option ", sizeof(string)); strlcat(string, name, sizeof(string)); append_statement(string, sizeof(string), " ", buf); @@ -1894,26 +1894,26 @@ lease_as_string(char *ifname, char *type, struct client_lease *lease) rslt = strftime(timebuf, sizeof(timebuf), DB_TIMEFMT, gmtime(&lease->renewal)); if (rslt == 0) - return (NULL); + return NULL; append_statement(string, sizeof(string), " renew ", timebuf); rslt = strftime(timebuf, sizeof(timebuf), DB_TIMEFMT, gmtime(&lease->rebind)); if (rslt == 0) - return (NULL); + return NULL; append_statement(string, sizeof(string), " rebind ", timebuf); rslt = strftime(timebuf, sizeof(timebuf), DB_TIMEFMT, gmtime(&lease->expiry)); if (rslt == 0) - return (NULL); + return NULL; append_statement(string, sizeof(string), " expire ", timebuf); rslt = strlcat(string, "}\n", sizeof(string)); if (rslt >= sizeof(string)) - return (NULL); + return NULL; - return (string); + return string ; } void @@ -1943,14 +1943,14 @@ rdaemon(int devnull) { if (devnull == -1) { errno = EBADF; - return (-1); + return -1; } if (fcntl(devnull, F_GETFL) == -1) - return (-1); + return -1; switch (fork()) { case -1: - return (-1); + return -1; case 0: break; default: @@ -1958,7 +1958,7 @@ rdaemon(int devnull) } if (setsid() == -1) - return (-1); + return -1; (void)dup2(devnull, STDIN_FILENO); (void)dup2(devnull, STDOUT_FILENO); @@ -1966,7 +1966,7 @@ rdaemon(int devnull) if (devnull > 2) (void)close(devnull); - return (0); + return 0; } int @@ -1983,9 +1983,9 @@ res_hnok(const char *name) ; } else if (pch == '.' || nch == '.' || nch == '\0') { if (!isalnum(ch)) - return (0); + return 0; } else if (!isalnum(ch) && ch != '-' && ch != '_') { - return (0); + return 0; } else if (ch == '_' && warn == 0) { log_warnx("warning: hostname %s contains an " "underscore which violates RFC 952", name); @@ -1993,7 +1993,7 @@ res_hnok(const char *name) } pch = ch, ch = nch; } - return (1); + return 1; } /* @@ -2008,7 +2008,7 @@ res_hnok_list(const char *names) int count; if (strlen(names) >= DHCP_DOMAIN_SEARCH_LEN) - return (0); + return 0; dupnames = inputstring = strdup(names); if (inputstring == NULL) @@ -2027,7 +2027,7 @@ res_hnok_list(const char *names) free(dupnames); - return (count > 0 && count < 7 && hn == NULL); + return count > 0 && count < 7 && hn == NULL; } void @@ -2277,7 +2277,7 @@ apply_defaults(struct client_lease *lease) newlease->options[DHO_STATIC_ROUTES].len = 0; } - return (newlease); + return newlease; cleanup: if (newlease) { @@ -2288,7 +2288,7 @@ cleanup: fatalx("Unable to apply defaults"); /* NOTREACHED */ - return (NULL); + return NULL; } struct client_lease * @@ -2338,7 +2338,7 @@ clone_lease(struct client_lease *oldlease) newlease->options[i].len); } - return (newlease); + return newlease; cleanup: if (newlease) { @@ -2346,7 +2346,7 @@ cleanup: free_client_lease(newlease); } - return (NULL); + return NULL; } /* @@ -2455,39 +2455,39 @@ compare_lease(struct client_lease *active, struct client_lease *new) int i; if (active == new) - return (0); + return 0; if (!new || !active) - return (1); + return 1; if (active->address.s_addr != new->address.s_addr || active->is_static != new->is_static || BOOTP_LEASE(active) != BOOTP_LEASE(new)) - return (1); + return 1; if (active->server_name != new->server_name) { if (!active->server_name || !new->server_name) - return (1); + return 1; if (strcmp(active->server_name, new->server_name) != 0) - return (1); + return 1; } if (active->filename != new->filename) { if (!active->filename || !new->filename) - return (1); + return 1; if (strcmp(active->filename, new->filename) != 0) - return (1); + return 1; } for (i = 0; i < DHO_COUNT; i++) { if (active->options[i].len != new->options[i].len) - return (1); + return 1; if (memcmp(active->options[i].data, new->options[i].data, active->options[i].len)) - return (1); + return 1; } - return (0); + return 0; } void @@ -2578,7 +2578,7 @@ get_recorded_lease(struct interface_info *ifi) break; } - return (lp); + return lp; } void diff --git a/sbin/dhclient/kroute.c b/sbin/dhclient/kroute.c index ef78259022b..003e2db5f91 100644 --- a/sbin/dhclient/kroute.c +++ b/sbin/dhclient/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.104 2017/07/09 12:38:47 krw Exp $ */ +/* $OpenBSD: kroute.c,v 1.105 2017/07/09 19:19:58 krw Exp $ */ /* * Copyright 2012 Kenneth R Westerback @@ -99,26 +99,26 @@ check_route_label(struct sockaddr_rtlabel *label) pid_t pid; if (!label) - return (ROUTE_LABEL_NONE); + return ROUTE_LABEL_NONE; if (strncmp("DHCLIENT ", label->sr_label, 9) != 0) - return (ROUTE_LABEL_NOT_DHCLIENT); + return ROUTE_LABEL_NOT_DHCLIENT; pid = (pid_t)strtonum(label->sr_label + 9, 1, INT_MAX, NULL); if (pid <= 0) - return (ROUTE_LABEL_DHCLIENT_UNKNOWN); + return ROUTE_LABEL_DHCLIENT_UNKNOWN; if (pid == getpid()) - return (ROUTE_LABEL_DHCLIENT_OURS); + return ROUTE_LABEL_DHCLIENT_OURS; if (kill(pid, 0) == -1) { if (errno == ESRCH) - return (ROUTE_LABEL_DHCLIENT_DEAD); + return ROUTE_LABEL_DHCLIENT_DEAD; else - return (ROUTE_LABEL_DHCLIENT_UNKNOWN); + return ROUTE_LABEL_DHCLIENT_UNKNOWN; } - return (ROUTE_LABEL_DHCLIENT_LIVE); + return ROUTE_LABEL_DHCLIENT_LIVE; } /* @@ -393,10 +393,10 @@ create_route_label(struct sockaddr_rtlabel *label) if (len == -1 || (unsigned int)len >= sizeof(label->sr_label)) { log_warn("could not create route label"); - return (1); + return 1; } - return (0); + return 0; } /* @@ -834,7 +834,7 @@ resolv_conf_priority(int rdomain, int routefd) rslt = 1; done: - return (rslt); + return rslt; } /* @@ -898,7 +898,7 @@ resolv_conf_contents(char *name, if (len == 0) { free(dn); - return (NULL); + return NULL; } rslt = asprintf(&courtesy, "# Generated by %s dhclient\n", name); @@ -927,7 +927,7 @@ resolv_conf_contents(char *name, if (config->resolv_tail) strlcat(contents, config->resolv_tail, len); - return (contents); + return contents; } /* diff --git a/sbin/dhclient/options.c b/sbin/dhclient/options.c index c0309e94fe9..4498480788d 100644 --- a/sbin/dhclient/options.c +++ b/sbin/dhclient/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.97 2017/07/08 20:38:31 krw Exp $ */ +/* $OpenBSD: options.c,v 1.98 2017/07/09 19:19:58 krw Exp $ */ /* DHCP options parsing and reassembly. */ @@ -432,11 +432,11 @@ parse_option_buffer(struct option_data *options, unsigned char *buffer, } else { log_warnx("option %s (%d) larger than buffer.", name, len); - return (0); + return 0; } } else { log_warnx("option %s has no length field.", name); - return (0); + return 0; } /* @@ -486,7 +486,7 @@ parse_option_buffer(struct option_data *options, unsigned char *buffer, s += len + 2; } - return (1); + return 1; } /* @@ -515,7 +515,7 @@ pack_options(unsigned char *buf, int buflen, struct option_data *options) length = options[code].len; if (bufix + length + 2*((length+254)/255) >= buflen) - return (lastopt); + return lastopt; lastopt = bufix; ix = 0; @@ -538,7 +538,7 @@ pack_options(unsigned char *buf, int buflen, struct option_data *options) lastopt = bufix; } - return (lastopt); + return lastopt; } /* @@ -572,9 +572,9 @@ pretty_print_string(unsigned char *src, size_t srclen, int emit_punct) rslt = strlcat(string, "\"", sizeof(string)); if (rslt >= sizeof(string)) - return (NULL); + return NULL; - return (string); + return string; } /* @@ -600,10 +600,10 @@ pretty_print_classless_routes(unsigned char *src, size_t srclen) bytes = (bits + 7) / 8; if (srclen < (bytes + sizeof(gateway.s_addr)) || bytes > sizeof(net.s_addr)) - return (NULL); + return NULL; rslt = snprintf(bitsbuf, sizeof(bitsbuf), "/%d ", bits); if (rslt == -1 || (unsigned int)rslt >= sizeof(bitsbuf)) - return (NULL); + return NULL; memset(&net, 0, sizeof(net)); memcpy(&net.s_addr, src, bytes); @@ -620,10 +620,10 @@ pretty_print_classless_routes(unsigned char *src, size_t srclen) strlcat(string, bitsbuf, sizeof(string)); if (strlcat(string, inet_ntoa(gateway), sizeof(string)) >= sizeof(string)) - return (NULL); + return NULL; } - return (string); + return string; } int @@ -646,14 +646,14 @@ expand_search_domain_name(unsigned char *src, size_t srclen, int *offset, * domain name. */ *offset = i + 1; - return (domain_name_len); + return domain_name_len; } else if (label_len & 0xC0) { /* This is a pointer to another list of labels. */ if (i + 1 >= srclen) { /* The pointer is truncated. */ log_warnx("Truncated pointer in DHCP Domain " "Search option."); - return (-1); + return -1; } pointer = ((label_len & ~(0xC0)) << 8) + src[i + 1]; @@ -664,7 +664,7 @@ expand_search_domain_name(unsigned char *src, size_t srclen, int *offset, */ log_warnx("Invalid forward pointer in DHCP " "Domain Search option compression."); - return (-1); + return -1; } pointed_len = expand_search_domain_name(src, srclen, @@ -672,12 +672,12 @@ expand_search_domain_name(unsigned char *src, size_t srclen, int *offset, domain_name_len += pointed_len; *offset = i + 2; - return (domain_name_len); + return domain_name_len; } if (i + label_len + 1 > srclen) { log_warnx("Truncated label in DHCP Domain Search " "option."); - return (-1); + return -1; } /* * Update the domain name length with the length of the @@ -688,7 +688,7 @@ expand_search_domain_name(unsigned char *src, size_t srclen, int *offset, if (strlen(domain_search) + domain_name_len >= DHCP_DOMAIN_SEARCH_LEN) { log_warnx("Domain search list too long."); - return (-1); + return -1; } /* Copy the label found. */ @@ -702,7 +702,7 @@ expand_search_domain_name(unsigned char *src, size_t srclen, int *offset, log_warnx("Truncated DHCP Domain Search option."); - return (-1); + return -1; } /* @@ -732,14 +732,14 @@ pretty_print_domain_search(unsigned char *src, size_t srclen) len = expand_search_domain_name(src, srclen, &offset, domain_search); if (len == -1) - return (NULL); + return NULL; domains++; expanded_len += len; if (domains > DHCP_DOMAIN_SEARCH_CNT) - return (NULL); + return NULL; } - return (domain_search); + return domain_search; } /* @@ -955,11 +955,11 @@ pretty_print_option(unsigned int code, struct option_data *option, } done: - return (optbuf); + return optbuf; toobig: memset(optbuf, 0, sizeof(optbuf)); - return (optbuf); + return optbuf; } struct option_data * diff --git a/sbin/dhclient/packet.c b/sbin/dhclient/packet.c index 810649fbf02..603bc5003c6 100644 --- a/sbin/dhclient/packet.c +++ b/sbin/dhclient/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.37 2017/07/08 00:36:10 krw Exp $ */ +/* $OpenBSD: packet.c,v 1.38 2017/07/09 19:19:58 krw Exp $ */ /* Packet assembly code, originally contributed by Archie Cobbs. */ @@ -82,14 +82,14 @@ checksum(unsigned char *buf, uint32_t nbytes, uint32_t sum) sum -= 0xFFFF; } - return (sum); + return sum; } uint32_t wrapsum(uint32_t sum) { sum = ~sum & 0xFFFF; - return (htons(sum)); + return htons(sum); } void @@ -109,13 +109,13 @@ decode_hw_header(unsigned char *buf, uint32_t buflen, struct ether_addr *from) struct ether_header eh; if (buflen < sizeof(eh)) - return (-1); + return -1; memcpy(&eh, buf, sizeof(eh)); memcpy(from->ether_addr_octet, eh.ether_shost, ETHER_ADDR_LEN); - return (sizeof(eh)); + return sizeof(eh); } ssize_t @@ -137,10 +137,10 @@ decode_udp_ip_header(unsigned char *buf, uint32_t buflen, /* Assure that an entire IP header is within the buffer. */ if (sizeof(*ip) > buflen) - return (-1); + return -1; ip_len = (*buf & 0xf) << 2; if (ip_len > buflen) - return (-1); + return -1; ip = (struct ip *)(buf); ip_packets_seen++; @@ -153,7 +153,7 @@ decode_udp_ip_header(unsigned char *buf, uint32_t buflen, ip_packets_bad_checksum, ip_packets_seen); ip_packets_seen = ip_packets_bad_checksum = 0; } - return (-1); + return -1; } memcpy(&from->sin_addr, &ip->ip_src, sizeof(from->sin_addr)); @@ -166,17 +166,17 @@ decode_udp_ip_header(unsigned char *buf, uint32_t buflen, /* Assure that the entire IP packet is within the buffer. */ if (ntohs(ip->ip_len) > buflen) - return (-1); + return -1; /* Assure that the UDP header is within the buffer. */ if (ip_len + sizeof(*udp) > buflen) - return (-1); + return -1; udp = (struct udphdr *)(buf + ip_len); udp_packets_seen++; /* Assure that the entire UDP packet is within the buffer. */ if (ip_len + ntohs(udp->uh_ulen) > buflen) - return (-1); + return -1; data = buf + ip_len + sizeof(*udp); /* @@ -198,7 +198,7 @@ decode_udp_ip_header(unsigned char *buf, uint32_t buflen, udp_packets_length_overflow = udp_packets_length_checked = 0; } - return (-1); + return -1; } #ifdef DEBUG if (len + data != buf + buflen) @@ -222,10 +222,10 @@ decode_udp_ip_header(unsigned char *buf, uint32_t buflen, udp_packets_bad_checksum, udp_packets_seen); udp_packets_seen = udp_packets_bad_checksum = 0; } - return (-1); + return -1; } memcpy(&from->sin_port, &udp->uh_sport, sizeof(udp->uh_sport)); - return (ip_len + sizeof(*udp)); + return ip_len + sizeof(*udp); } diff --git a/sbin/dhclient/parse.c b/sbin/dhclient/parse.c index 841841d9093..1dc5feb64c6 100644 --- a/sbin/dhclient/parse.c +++ b/sbin/dhclient/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.56 2017/07/09 18:45:27 krw Exp $ */ +/* $OpenBSD: parse.c,v 1.57 2017/07/09 19:19:58 krw Exp $ */ /* Common parser code for dhcpd and dhclient. */ @@ -123,9 +123,9 @@ parse_semi(FILE *cfile) if (token != ';') { parse_warn("expecting semicolon."); skip_to_semi(cfile); - return (0); + return 0; } - return (1); + return 1; } char * @@ -140,13 +140,13 @@ parse_string(FILE *cfile, unsigned int *len) parse_warn("expecting string."); if (token != ';') skip_to_semi(cfile); - return (NULL); + return NULL; } i = strnunvis(unvisbuf, val, sizeof(unvisbuf)); if (i == -1) { parse_warn("could not unvis string"); - return (NULL); + return NULL; } s = malloc(i+1); if (!s) @@ -155,7 +155,7 @@ parse_string(FILE *cfile, unsigned int *len) if (len != NULL) *len = i; - return (s); + return s; } /* cidr :== ip-address "/" bit-count @@ -183,18 +183,18 @@ parse_cidr(FILE *cfile, unsigned char *cidr) if (!len) { parse_warn("expecting decimal value."); skip_to_semi(cfile); - return (0); + return 0; } else if (token != '/') { parse_warn("expecting '/'."); skip_to_semi(cfile); - return (0); + return 0; } else if (!parse_decimal(cfile, cidr, 'B') || *cidr > 32) { parse_warn("expecting decimal value <= 32."); skip_to_semi(cfile); - return (0); + return 0; } - return (1); + return 1; } int @@ -214,15 +214,15 @@ parse_ip_addr(FILE *cfile, struct in_addr *addr) if (len == 4) { memcpy(addr, &buf, sizeof(*addr)); - return (1); + return 1; } else if (token != '.') { parse_warn("expecting '.'."); skip_to_semi(cfile); - return (0); + return 0; } else { parse_warn("expecting decimal value."); skip_to_semi(cfile); - return (0); + return 0; } } @@ -256,16 +256,16 @@ parse_boolean(FILE *cfile, unsigned char *buf) if (strcasecmp(val, "true") == 0 || strcasecmp(val, "on") == 0) { buf[0] = 1; - return (1); + return 1; } if (strcasecmp(val, "false") == 0 || strcasecmp(val, "off") == 0) { buf[0] = 0; - return (1); + return 1; } } - return (0); + return 0; } int @@ -300,17 +300,17 @@ parse_decimal(FILE *cfile, unsigned char *buf, char fmt) bytes = 1; break; default: - return (0); + return 0; } numval = strtonum(val, low, high, &errstr); if (errstr) - return (0); + return 0; numval = htobe64(numval); memcpy(buf, (char *)&numval + (sizeof(numval) - bytes), bytes); - return (1); + return 1; } int @@ -327,11 +327,11 @@ parse_hex(FILE *cfile, unsigned char *buf) if ((val[0] == '\0' || *ep != '\0') || (errno == ERANGE && ulval == ULONG_MAX) || (ulval > UINT8_MAX)) - return (0); + return 0; buf[0] = ulval; - return (1); + return 1; } /* @@ -368,7 +368,7 @@ parse_date(FILE *cfile) /* XXX Will break after year 9999! */ parse_warn("time string too long"); skip_to_semi(cfile); - return (0); + return 0; } break; case';': @@ -376,7 +376,7 @@ parse_date(FILE *cfile) default: parse_warn("invalid time string"); skip_to_semi(cfile); - return (0); + return 0; } } while (token != ';'); @@ -386,16 +386,16 @@ parse_date(FILE *cfile) p = strptime(timestr, DB_TIMEFMT, &tm); if (p == NULL || *p != '\0') { parse_warn("unparseable time string"); - return (0); + return 0; } guess = timegm(&tm); if (guess == -1) { parse_warn("time could not be represented"); - return (0); + return 0; } - return (guess); + return guess; } void -- 2.20.1