# SDL: Fixed warning C4701: potentially uninitialized local variable 'drawnTextRect' used

**URL:** <https://discourse.libsdl.org/t/sdl-fixed-warning-c4701-potentially-uninitialized-local-variable-drawntextrect-used/49016>\
**Category:** SDL Commits\
**Created:** [February 3, 2024, 7:51pm UTC](https://discourse.libsdl.org/t/sdl-fixed-warning-c4701-potentially-uninitialized-local-variable-drawntextrect-used/49016 "2024-02-03T19:51:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [February 3, 2024, 7:51pm UTC](https://discourse.libsdl.org/t/sdl-fixed-warning-c4701-potentially-uninitialized-local-variable-drawntextrect-used/49016/1 "2024-02-03T19:51:24Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/c0b27ccef9901b1068cee591e5b1efd684476a26>

```diff
From c0b27ccef9901b1068cee591e5b1efd684476a26 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 3 Feb 2024 11:31:47 -0800
Subject: [PATCH] Fixed warning C4701: potentially uninitialized local variable
 'drawnTextRect' used

---
 test/testime.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/test/testime.c b/test/testime.c
index 003b3f19b45a..37b74f13aff1 100644
--- a/test/testime.c
+++ b/test/testime.c
@@ -468,7 +468,9 @@ static void _Redraw(int rendererID)
     SDL_Renderer *renderer = state->renderers[rendererID];
     SDL_FRect drawnTextRect, cursorRect, underlineRect;
     drawnTextRect.x = textRect.x;
+ drawnTextRect.y = 0;
     drawnTextRect.w = 0;
+ drawnTextRect.h = 0;
 
     SDL_SetRenderDrawColor(renderer, backColor.r, backColor.g, backColor.b, backColor.a);
     SDL_RenderFillRect(renderer, &textRect);

```
