From c54cb9f338830e3d8b7afdc7c7110ecdf946313f Mon Sep 17 00:00:00 2001 From: rbuj Date: Tue, 14 Dec 2021 14:59:36 +0100 Subject: xdg-user-dir-lookup: Fix -Wshorten-64-to-32 warning --- savers/xdg-user-dir-lookup.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/savers/xdg-user-dir-lookup.c b/savers/xdg-user-dir-lookup.c index 83e2c7e..3a563c7 100644 --- a/savers/xdg-user-dir-lookup.c +++ b/savers/xdg-user-dir-lookup.c @@ -40,7 +40,6 @@ xdg_user_dir_lookup (const char *type) char buffer[512]; char *user_dir; char *p, *d; - int len; int relative; home_dir = getenv ("HOME"); @@ -71,8 +70,8 @@ xdg_user_dir_lookup (const char *type) while (fgets (buffer, sizeof (buffer), file)) { /* Remove newline at end */ - len = strlen (buffer); - if (len > 0 && buffer[len-1] == '\n') + size_t len = strlen (buffer); + if (len != 0 && buffer[len-1] == '\n') buffer[len-1] = 0; p = buffer; -- cgit v1.2.1