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