...
| Code Block | ||
|---|---|---|
| ||
void check_password(const char *user, const char *password) { if (strcmp(password(user), password) != 0) { char *msg = malloc(strlen(user) + 100); if (!msg) { /* handle error condition */ } sprintf (msg, "%s password incorrect", user); fprintf(STDERR, msg); syslog(LOG_INFO, msg); free(msg); } } |
...
| Code Block | ||
|---|---|---|
| ||
void check_password(const char *user, const char *password) { if (strcmp(password(user), password) != 0) { fprintf (stderr, "%s password incorrect", user); } } |
...
| Code Block | ||
|---|---|---|
| ||
void check_password(const char *user, const char *password) { if (strcmp(password(user), password) != 0) { char *msg = malloc(strlen(user) + 100); if (!msg) { /* handle error condition */ } sprintf (msg, "%s password incorrect", user); fprintf (stderr, "%s", user); syslog(LOG_INFO, "%s", msg); free(msg); } } |
...