Changeset 132ab5d1 in mainline for uspace/lib/c/generic/inet/addr.c


Ignore:
Timestamp:
2018-01-30T03:20:45Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a6cc679
Parents:
8bfb163 (diff), 6a5d05b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge commit '6a5d05bd2551e64111bea4f9332dd7448c26ce84' into forwardport

Separate return value from error code in gen_irq_code*().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/inet/addr.c

    r8bfb163 r132ab5d1  
    3939#include <stdio.h>
    4040#include <stddef.h>
    41 #include <malloc.h>
     41#include <stdlib.h>
    4242#include <bitops.h>
    4343#include <inttypes.h>
     
    584584{
    585585        int rc;
     586        int ret;
    586587
    587588        rc = ENOTSUP;
     
    589590        switch (addr->version) {
    590591        case ip_any:
    591                 rc = asprintf(bufp, "none");
    592                 if (rc < 0)
     592                ret = asprintf(bufp, "none");
     593                if (ret < 0)
    593594                        return ENOMEM;
    594595                rc = EOK;
     
    618619{
    619620        int rc;
     621        int ret;
    620622        char *astr;
    621623
     
    624626        switch (naddr->version) {
    625627        case ip_any:
    626                 rc = asprintf(bufp, "none");
    627                 if (rc < 0)
     628                ret = asprintf(bufp, "none");
     629                if (ret < 0)
    628630                        return ENOMEM;
    629631                rc = EOK;
     
    634636                        return ENOMEM;
    635637
    636                 rc = asprintf(bufp, "%s/%" PRIu8, astr, naddr->prefix);
    637                 if (rc < 0) {
     638                ret = asprintf(bufp, "%s/%" PRIu8, astr, naddr->prefix);
     639                if (ret < 0) {
    638640                        free(astr);
    639641                        return ENOMEM;
     
    647649                        return ENOMEM;
    648650
    649                 rc = asprintf(bufp, "%s/%" PRIu8, astr, naddr->prefix);
    650                 if (rc < 0) {
     651                ret = asprintf(bufp, "%s/%" PRIu8, astr, naddr->prefix);
     652                if (ret < 0) {
    651653                        free(astr);
    652654                        return ENOMEM;
Note: See TracChangeset for help on using the changeset viewer.