From f32e415aea6797d261d6b470dcf8bf18727341c2 Mon Sep 17 00:00:00 2001 From: Jose Fernandez Date: Fri, 5 Jun 2026 21:07:44 -0600 Subject: [PATCH] libgamestream: fix uniqueid.dat read check fread(unique_id, UNIQUEID_CHARS, 1, fd) returns the number of items read (1 on success), not bytes, so the != UNIQUEID_CHARS comparison is always true. Any existing uniqueid.dat is silently ignored and rewritten with the default 0123456789ABCDEF on every run, making a custom per-device uniqueid impossible. --- libgamestream/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgamestream/client.c b/libgamestream/client.c index fe6fcd4..63e2d55 100644 --- a/libgamestream/client.c +++ b/libgamestream/client.c @@ -92,7 +92,7 @@ static int load_unique_id(const char* keyDirectory) { snprintf(uniqueFilePath, PATH_MAX, "%s/%s", keyDirectory, UNIQUE_FILE_NAME); FILE *fd = fopen(uniqueFilePath, "r"); - if (fd == NULL || fread(unique_id, UNIQUEID_CHARS, 1, fd) != UNIQUEID_CHARS) { + if (fd == NULL || fread(unique_id, UNIQUEID_CHARS, 1, fd) != 1) { snprintf(unique_id,UNIQUEID_CHARS+1,"0123456789ABCDEF"); if (fd)