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