Changeset 19 in openpam


Ignore:
Timestamp:
Feb 2, 2002, 6:04:31 PM (12 years ago)
Author:
des
Message:

Use 'sizeof(foo)' instead of 'sizeof foo' even where it's not
required. Although style(9) doesn't say anything about it, this
seems to be the preferred form.

Sponsored by: DARPA, NAI Labs

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/su/su.c

    r16 r19  
    9393 
    9494        /* set some items */ 
    95         gethostname(hostname, sizeof hostname); 
     95        gethostname(hostname, sizeof(hostname)); 
    9696        check("pam_set_item", pam_set_item(pamh, PAM_RHOST, hostname)); 
    9797        user = getlogin(); 
  • trunk/lib/openpam_ttyconv.c

    r16 r19  
    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_set_data.c

    r16 r19  
    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

    r16 r19  
    6666        int r; 
    6767 
    68         if ((ph = calloc(1, sizeof *ph)) == NULL) 
     68        if ((ph = calloc(1, sizeof(*ph))) == NULL) 
    6969                return (PAM_BUF_ERR); 
    7070        if ((r = pam_set_item(ph, PAM_SERVICE, service)) != PAM_SUCCESS) 
     
    111111 
    112112        /* fill in configuration data */ 
    113         if ((module = malloc(sizeof *module)) == NULL) { 
     113        if ((module = malloc(sizeof(*module))) == NULL) { 
    114114                openpam_log(PAM_LOG_ERROR, "malloc(): %m"); 
    115115                return (PAM_BUF_ERR); 
  • trunk/lib/pam_strerror.c

    r16 r19  
    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.