1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 18:55:40 +03:00

Merge pull request #22130 from keszybz/silence-gcc-warning-in-sd-device

Silence gcc warning in sd-device
This commit is contained in:
Luca Boccassi 2022-01-15 16:22:59 +00:00 committed by GitHub
commit 8a592c6fc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1392,7 +1392,7 @@ int device_read_db_internal_filename(sd_device *device, const char *filename) {
_cleanup_free_ char *db = NULL;
const char *value;
size_t db_len;
char key;
char key = '\0'; /* Unnecessary initialization to appease gcc-12.0.0-0.4.fc36 */
int r;
enum {
@ -1419,7 +1419,7 @@ int device_read_db_internal_filename(sd_device *device, const char *filename) {
device->db_loaded = true;
for (size_t i = 0; i < db_len; i++) {
for (size_t i = 0; i < db_len; i++)
switch (state) {
case PRE_KEY:
if (!strchr(NEWLINE, db[i])) {
@ -1467,7 +1467,6 @@ int device_read_db_internal_filename(sd_device *device, const char *filename) {
default:
return log_device_debug_errno(device, SYNTHETIC_ERRNO(EINVAL), "sd-device: invalid db syntax.");
}
}
return 0;
}