瀏覽代碼

Fix action_edit int range bug (#13737)

Marcio Teixeira 6 年之前
父節點
當前提交
836435c5ef
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      Marlin/src/lcd/menu/menu.h

+ 2
- 2
Marlin/src/lcd/menu/menu.h 查看文件

182
   public:
182
   public:
183
     static void action_edit(PGM_P const pstr, type_t * const ptr, const type_t minValue, const type_t maxValue, const screenFunc_t callback=NULL, const bool live=false) {
183
     static void action_edit(PGM_P const pstr, type_t * const ptr, const type_t minValue, const type_t maxValue, const screenFunc_t callback=NULL, const bool live=false) {
184
       // Make sure minv and maxv fit within int16_t
184
       // Make sure minv and maxv fit within int16_t
185
-      const int16_t minv = MAX(scale(minValue), INT_MIN),
186
-                    maxv = MIN(scale(maxValue), INT_MAX);
185
+      const int16_t minv = MAX(scale(minValue), INT16_MIN),
186
+                    maxv = MIN(scale(maxValue), INT16_MAX);
187
       init(pstr, ptr, minv, maxv - minv, scale(*ptr) - minv, edit, callback, live);
187
       init(pstr, ptr, minv, maxv - minv, scale(*ptr) - minv, edit, callback, live);
188
     }
188
     }
189
     static void edit() { MenuItemBase::edit(to_string, load); }
189
     static void edit() { MenuItemBase::edit(to_string, load); }

Loading…
取消
儲存