diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-03-13 04:59:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-03-13 05:03:18 +0400 |
commit | c17acf1d6e039305ca5549df0dd37e821dcde3d5 (patch) | |
tree | f5e87e9fa545e54328f590fb5c4d120606c7346f /source/blender/editors/space_info | |
parent | 37cf28b3412f0d888b16e793360b9d064be1aa25 (diff) |
Code cleanup: quiet warning, 'else' would always crash (& never occurred)
also quiet waning clamping
Diffstat (limited to 'source/blender/editors/space_info')
-rw-r--r-- | source/blender/editors/space_info/textview.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index d4d45af6431..879c99c35d5 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -294,7 +294,9 @@ int textview_draw(TextViewContext *tvc, const int draw, int mval[2], void **mous cdc.lofs = -BLF_descender(mono); /* note, scroll bar must be already subtracted () */ cdc.console_width = (tvc->winx - (CONSOLE_DRAW_MARGIN * 2) ) / cdc.cwidth; - CLAMP(cdc.console_width, 1, INT_MAX); /* avoid divide by zero on small windows */ + /* avoid divide by zero on small windows */ + if (cdc.console_width < 1) + cdc.console_width = 1; cdc.winx = tvc->winx - CONSOLE_DRAW_MARGIN; cdc.ymin = tvc->ymin; cdc.ymax = tvc->ymax; |