diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2012-12-22 22:38:26 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2012-12-22 22:38:26 +0100 |
commit | c7bb19c55c7a902e25bdd33b0d49a2ddcf62e07a (patch) | |
tree | b3a75ef2719bc2f334041460fd21fbdf86a23a82 /compat/pam_prompt.c | |
parent | d336cd6b429f8ce40c58ea287f79bbc7c23d0966 (diff) |
update C coding style to a more commonly used style
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1873 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'compat/pam_prompt.c')
-rw-r--r-- | compat/pam_prompt.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/compat/pam_prompt.c b/compat/pam_prompt.c index 6e1b779..d2fd761 100644 --- a/compat/pam_prompt.c +++ b/compat/pam_prompt.c @@ -1,7 +1,7 @@ /* pam_prompt.c - replacement function for pam_prompt() - Copyright (C) 2010 Arthur de Jong + Copyright (C) 2010, 2012 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,8 @@ #include "compat/attrs.h" #include "compat/pam_compat.h" -int pam_prompt(pam_handle_t *pamh,int style,char **response,const char *format,...) +int pam_prompt(pam_handle_t *pamh, int style, char **response, + const char *format, ...) { int rc; struct pam_conv *aconv; @@ -37,33 +38,33 @@ int pam_prompt(pam_handle_t *pamh,int style,char **response,const char *format,. struct pam_message msg, *pmsg; struct pam_response *resp; /* the the conversion function */ - rc=pam_get_item(pamh,PAM_CONV,(const void **)&aconv); - if (rc!=PAM_SUCCESS) + rc = pam_get_item(pamh, PAM_CONV, (const void **)&aconv); + if (rc != PAM_SUCCESS) return rc; /* make the message string */ - va_start(ap,format); - vsnprintf(buffer,sizeof(buffer),format,ap); - buffer[sizeof(buffer)-1]='\0'; + va_start(ap, format); + vsnprintf(buffer, sizeof(buffer), format, ap); + buffer[sizeof(buffer) - 1] = '\0'; va_end(ap); /* build the message */ - msg.msg_style=style; - msg.msg=buffer; - pmsg=&msg; - resp=NULL; - rc=aconv->conv(1,(const struct pam_message **)&pmsg,&resp,aconv->appdata_ptr); - if (rc!=PAM_SUCCESS) + msg.msg_style = style; + msg.msg = buffer; + pmsg = &msg; + resp = NULL; + rc = aconv->conv(1, (const struct pam_message **)&pmsg, &resp, aconv->appdata_ptr); + if (rc != PAM_SUCCESS) return rc; /* assign response if it is set */ - if (response!=NULL) + if (response != NULL) { - if (resp==NULL) + if (resp == NULL) return PAM_CONV_ERR; - if (resp[0].resp==NULL) + if (resp[0].resp == NULL) { free(resp); return PAM_CONV_ERR; } - *response=resp[0].resp; + *response = resp[0].resp; } else free(resp[0].resp); |