Przeglądaj źródła

Merge pull request #797 from oflebbe/glyph

fix: unintialized data in glyph
Rob Loach 6 miesięcy temu
rodzic
commit
e5e427030f
4 zmienionych plików z 5 dodań i 3 usunięć
  1. 1 1
      clib.json
  2. 2 1
      nuklear.h
  3. 1 0
      src/CHANGELOG
  4. 1 1
      src/nuklear_input.c

+ 1 - 1
clib.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "nuklear",
   "name": "nuklear",
-  "version": "4.12.5",
+  "version": "4.12.6",
   "repo": "Immediate-Mode-UI/Nuklear",
   "repo": "Immediate-Mode-UI/Nuklear",
   "description": "A small ANSI C gui toolkit",
   "description": "A small ANSI C gui toolkit",
   "keywords": ["gl", "ui", "toolkit"],
   "keywords": ["gl", "ui", "toolkit"],

+ 2 - 1
nuklear.h

@@ -18304,7 +18304,7 @@ nk_input_glyph(struct nk_context *ctx, const nk_glyph glyph)
 NK_API void
 NK_API void
 nk_input_char(struct nk_context *ctx, char c)
 nk_input_char(struct nk_context *ctx, char c)
 {
 {
-    nk_glyph glyph;
+    nk_glyph glyph = {0};
     NK_ASSERT(ctx);
     NK_ASSERT(ctx);
     if (!ctx) return;
     if (!ctx) return;
     glyph[0] = c;
     glyph[0] = c;
@@ -30700,6 +30700,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
 ///   - [y]: Minor version with non-breaking API and library changes
 ///   - [y]: Minor version with non-breaking API and library changes
 ///   - [z]: Patch version with no direct changes to the API
 ///   - [z]: Patch version with no direct changes to the API
 ///
 ///
+/// - 2025/03/29 (4.12.6) - Fix unitialized data in nk_input_char
 /// - 2025/03/05 (4.12.5) - Fix scrolling knob also scrolling parent window, remove dead code
 /// - 2025/03/05 (4.12.5) - Fix scrolling knob also scrolling parent window, remove dead code
 /// - 2024/12/11 (4.12.4) - Fix array subscript [0, 0] is outside array bounds of ‘char[1]’
 /// - 2024/12/11 (4.12.4) - Fix array subscript [0, 0] is outside array bounds of ‘char[1]’
 /// - 2024/12/11 (4.12.3) - Fix border color for property widgets
 /// - 2024/12/11 (4.12.3) - Fix border color for property widgets

+ 1 - 0
src/CHANGELOG

@@ -7,6 +7,7 @@
 ///   - [y]: Minor version with non-breaking API and library changes
 ///   - [y]: Minor version with non-breaking API and library changes
 ///   - [z]: Patch version with no direct changes to the API
 ///   - [z]: Patch version with no direct changes to the API
 ///
 ///
+/// - 2025/03/29 (4.12.6) - Fix unitialized data in nk_input_char
 /// - 2025/03/05 (4.12.5) - Fix scrolling knob also scrolling parent window, remove dead code
 /// - 2025/03/05 (4.12.5) - Fix scrolling knob also scrolling parent window, remove dead code
 /// - 2024/12/11 (4.12.4) - Fix array subscript [0, 0] is outside array bounds of ‘char[1]’
 /// - 2024/12/11 (4.12.4) - Fix array subscript [0, 0] is outside array bounds of ‘char[1]’
 /// - 2024/12/11 (4.12.3) - Fix border color for property widgets
 /// - 2024/12/11 (4.12.3) - Fix border color for property widgets

+ 1 - 1
src/nuklear_input.c

@@ -124,7 +124,7 @@ nk_input_glyph(struct nk_context *ctx, const nk_glyph glyph)
 NK_API void
 NK_API void
 nk_input_char(struct nk_context *ctx, char c)
 nk_input_char(struct nk_context *ctx, char c)
 {
 {
-    nk_glyph glyph;
+    nk_glyph glyph = {0};
     NK_ASSERT(ctx);
     NK_ASSERT(ctx);
     if (!ctx) return;
     if (!ctx) return;
     glyph[0] = c;
     glyph[0] = c;