Changeset 262 in openpam for trunk/lib


Ignore:
Timestamp:
Jun 18, 2003, 11:41:27 AM (16 years ago)
Author:
Dag-Erling Smørgrav
Message:

Avoid side effects in macro arguments (don't I ever learn?); also
address some related style issues.

Submitted by: Dmitry V. Levin <ldv@…>

Location:
trunk/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/openpam_load.c

    r245 r262  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/openpam_load.c#19 $
     34 * $P4: //depot/projects/openpam/lib/openpam_load.c#20 $
    3535 */
    3636
     
    154154        openpam_destroy_chain(chain->next);
    155155        chain->next = NULL;
    156         while (chain->optc--)
     156        while (chain->optc) {
     157                --chain->optc;
    157158                FREE(chain->optv[chain->optc]);
     159        }
    158160        FREE(chain->optv);
    159161        openpam_release_module(chain->module);
     162        chain->module = NULL;
    160163        FREE(chain);
    161164}
  • trunk/lib/pam_end.c

    r245 r262  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/pam_end.c#13 $
     34 * $P4: //depot/projects/openpam/lib/pam_end.c#14 $
    3535 */
    3636
     
    6969
    7070        /* clear environment */
    71         while (pamh->env_count)
    72                 FREE(pamh->env[--pamh->env_count]);
     71        while (pamh->env_count) {
     72                --pamh->env_count;
     73                FREE(pamh->env[pamh->env_count]);
     74        }
    7375        FREE(pamh->env);
    7476
  • trunk/lib/pam_getenvlist.c

    r245 r262  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/pam_getenvlist.c#12 $
     34 * $P4: //depot/projects/openpam/lib/pam_getenvlist.c#13 $
    3535 */
    3636
     
    6666        for (i = 0; i < pamh->env_count; ++i) {
    6767                if ((envlist[i] = strdup(pamh->env[i])) == NULL) {
    68                         while (i)
    69                                 FREE(envlist[--i]);
     68                        while (i) {
     69                                --i;
     70                                FREE(envlist[i]);
     71                        }
    7072                        FREE(envlist);
    7173                        openpam_log(PAM_LOG_ERROR, "%s",
Note: See TracChangeset for help on using the changeset viewer.