From a4da1a924deb6667e25cd4bcc04454b7a5d4d1e2 Mon Sep 17 00:00:00 2001 From: Lucas Christiansson Date: Wed, 24 Sep 2025 23:43:29 +0200 Subject: [PATCH] fix: Correct error handling --- src/config/ConfigManager.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index ea7b5a3..4445605 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -42,11 +42,10 @@ static Hyprlang::CParseResult handleWallpaper(const char* C, const char* V) { WALLPAPER = std::string(ENVHOME) + WALLPAPER.substr(1); } - int rotation = 0; + uint32_t rotation = 0; if (secondComma != std::string::npos) { - std::string rotationStr = VALUE.substr(secondComma + 1); try { - rotation = std::stoi(rotationStr); + rotation = std::stoi(VALUE.substr(secondComma + 1)); if (rotation < 0 || rotation > 7) { result.setError("wallpaper failed (invalid rotation input: must be 0-7)"); return result;