Update utils.c spaces

This commit is contained in:
ck 2023-06-18 18:09:17 +02:00 committed by GitHub
parent 71b5ee6aee
commit 62b4073ccd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,50 +81,50 @@ size_t line_width(const char *buf, size_t bufsize, size_t pos)
void initfailed(int cardnumber, const char *reason, int exitcode) void initfailed(int cardnumber, const char *reason, int exitcode)
{ {
int fp; int fp;
char *str; char *str;
char sexitcode[16]; char sexitcode[16];
ssize_t bytes_written; ssize_t bytes_written;
if (statefile == NULL) if (statefile == NULL)
return; return;
if (snd_card_get_name(cardnumber, &str) < 0) if (snd_card_get_name(cardnumber, &str) < 0)
return; return;
sprintf(sexitcode, "%i", exitcode); sprintf(sexitcode, "%i", exitcode);
fp = open(statefile, O_WRONLY|O_CREAT|O_APPEND, 0644); fp = open(statefile, O_WRONLY|O_CREAT|O_APPEND, 0644);
bytes_written = write(fp, str, strlen(str)); bytes_written = write(fp, str, strlen(str));
if (bytes_written != strlen(str)) { if (bytes_written != strlen(str)) {
// Handle error // Handle error
} }
bytes_written = write(fp, ":", 1); bytes_written = write(fp, ":", 1);
if (bytes_written != 1) { if (bytes_written != 1) {
// Handle error // Handle error
} }
bytes_written = write(fp, reason, strlen(reason)); bytes_written = write(fp, reason, strlen(reason));
if (bytes_written != strlen(reason)) { if (bytes_written != strlen(reason)) {
// Handle error // Handle error
} }
bytes_written = write(fp, ":", 1); bytes_written = write(fp, ":", 1);
if (bytes_written != 1) { if (bytes_written != 1) {
// Handle error // Handle error
} }
bytes_written = write(fp, sexitcode, strlen(sexitcode)); bytes_written = write(fp, sexitcode, strlen(sexitcode));
if (bytes_written != strlen(sexitcode)) { if (bytes_written != strlen(sexitcode)) {
// Handle error // Handle error
} }
bytes_written = write(fp, "\n", 1); bytes_written = write(fp, "\n", 1);
if (bytes_written != 1) { if (bytes_written != 1) {
// Handle error // Handle error
} }
close(fp); close(fp);
free(str); free(str);
} }
static void syslog_(int prio, const char *fcn, long line, static void syslog_(int prio, const char *fcn, long line,