Changeset 35 in openpam


Ignore:
Timestamp:
Feb 6, 2002, 1:25:36 PM (16 years ago)
Author:
Dag-Erling Smørgrav
Message:

According to bde, it's OK to omit parentheses when taking the size
of an object rather than a type.

Sponsored by: DARPA, NAI Labs

Location:
trunk/lib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/openpam_load.c

    r34 r35  
    185185        pam_chain_t *new, *iterator;
    186186
    187         if ((new = calloc(1, sizeof(*new))) == NULL)
     187        if ((new = calloc(1, sizeof *new)) == NULL)
    188188                goto buf_err;
    189189        if ((new->optv = malloc(sizeof(char *) * (optc + 1))) == NULL)
  • trunk/lib/openpam_ttyconv.c

    r19 r35  
    6565        if (n <= 0 || n > PAM_MAX_NUM_MSG)
    6666                return (PAM_CONV_ERR);
    67         if ((*resp = calloc(n, sizeof(**resp))) == NULL)
     67        if ((*resp = calloc(n, sizeof **resp)) == NULL)
    6868                return (PAM_BUF_ERR);
    6969        fd = fileno(stdin);
     
    9292                        fputs(msg[i]->msg, stderr);
    9393                        buf[0] = '\0';
    94                         fgets(buf, sizeof(buf), stdin);
     94                        fgets(buf, sizeof buf, stdin);
    9595                        if (msg[i]->msg_style == PAM_PROMPT_ECHO_OFF) {
    9696                                tattr.c_lflag = lflag;
  • trunk/lib/pam_get_user.c

    r24 r35  
    5050int
    5151pam_get_user(pam_handle_t *pamh,
    52         char **user,
     52        const char **user,
    5353        const char *prompt)
    5454{
    55         char *p;
     55        char *p, *resp;
    5656        int r;
    5757
     
    5959                return (PAM_SYSTEM_ERR);
    6060
    61         r = pam_get_item(pamh, PAM_USER, (void **)user);
     61        r = pam_get_item(pamh, PAM_USER, (const void **)user);
    6262        if (r == PAM_SUCCESS)
    6363                return (PAM_SUCCESS);
    6464        if (prompt == NULL) {
    65                 if (pam_get_item(pamh, PAM_USER_PROMPT, (void **)&p) !=
    66                     PAM_SUCCESS || p == NULL)
     65                if (pam_get_item(pamh, PAM_USER_PROMPT,
     66                    (const void **)&p) != PAM_SUCCESS || p == NULL)
    6767                        prompt = "Login: ";
    6868        }
    69         r = pam_prompt(pamh, user, 0, "%s", prompt ? prompt : p);
     69        r = pam_prompt(pamh, &resp, 0, "%s", prompt ? prompt : p);
    7070        if (r != PAM_SUCCESS)
    7171                return (r);
     72        *user = resp;
    7273        return (pam_set_item(pamh, PAM_USER, *user));
    7374}
  • trunk/lib/pam_set_data.c

    r19 r35  
    7272        }
    7373
    74         if ((dp = malloc(sizeof(*dp))) == NULL)
     74        if ((dp = malloc(sizeof *dp)) == NULL)
    7575                return (PAM_BUF_ERR);
    7676        if ((dp->name = strdup(module_data_name)) == NULL) {
  • trunk/lib/pam_start.c

    r25 r35  
    6363        int r;
    6464
    65         if ((ph = calloc(1, sizeof(*ph))) == NULL)
     65        if ((ph = calloc(1, sizeof *ph)) == NULL)
    6666                return (PAM_BUF_ERR);
    6767        if ((r = pam_set_item(ph, PAM_SERVICE, service)) != PAM_SUCCESS)
  • trunk/lib/pam_strerror.c

    r19 r35  
    118118                return ("unknown authentication domain");
    119119        default:
    120                 snprintf(unknown, sizeof(unknown), "#%d", error_number);
     120                snprintf(unknown, sizeof unknown, "#%d", error_number);
    121121                return (unknown);
    122122        }
Note: See TracChangeset for help on using the changeset viewer.