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


Ignore:
Timestamp:
2017-12-20T22:25:34Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
39b54fe
Parents:
8610c2c
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-20 22:22:29)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-20 22:25:34)
Message:

"Obviously harmless" error handling tweaks.

File:
1 edited

Legend:

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

    r8610c2c rd5c1051  
    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.