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


Ignore:
Timestamp:
2017-12-20T22:25:34Z (8 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.

Location:
uspace/lib/c/generic/inet
Files:
2 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;
  • uspace/lib/c/generic/inet/hostport.c

    r8610c2c rd5c1051  
    140140{
    141141        int rc;
     142        int ret;
    142143        char *astr, *str;
    143144        char *hstr = NULL;
     
    154155                        hstr = astr;
    155156                } else {
    156                         rc = asprintf(&hstr, "[%s]", astr);
    157                         if (rc < 0) {
     157                        ret = asprintf(&hstr, "[%s]", astr);
     158                        if (ret < 0) {
    158159                                free(astr);
    159160                                return ENOMEM;
     
    171172        }
    172173
    173         rc = asprintf(&str, "%s:%u", hstr, hp->port);
    174         if (rc < 0)
     174        ret = asprintf(&str, "%s:%u", hstr, hp->port);
     175        if (ret < 0)
    175176                return ENOMEM;
    176177
Note: See TracChangeset for help on using the changeset viewer.