diff options
| author | Crydsch <[email protected]> | 2022-05-14 15:02:29 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-05-14 15:02:29 +0200 |
| commit | 020e90319388fb6e0975d2bb502d4824d369aece (patch) | |
| tree | 35e669b77fafe89aded6a8d3cfee7c748f592f99 | |
| parent | db16833d8cb8a252aeb1807fcbb8a600e2ab5900 (diff) | |
| download | raylib-020e90319388fb6e0975d2bb502d4824d369aece.tar.gz raylib-020e90319388fb6e0975d2bb502d4824d369aece.zip | |
Fix lgtm warnings (#2477)
* Comparison is always true because finalSample >= 1
* Comparison is always false because keyCount >= 0
| -rw-r--r-- | src/extras/raygui.h | 2 | ||||
| -rw-r--r-- | src/raudio.c | 3 |
2 files changed, 1 insertions, 4 deletions
diff --git a/src/extras/raygui.h b/src/extras/raygui.h index dfb7792c..d588279c 100644 --- a/src/extras/raygui.h +++ b/src/extras/raygui.h @@ -1999,7 +1999,6 @@ bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode) { keyCount--; text[keyCount] = '\0'; - if (keyCount < 0) keyCount = 0; } } @@ -2177,7 +2176,6 @@ bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, i { keyCount--; textValue[keyCount] = '\0'; - if (keyCount < 0) keyCount = 0; valueHasChanged = true; } } diff --git a/src/raudio.c b/src/raudio.c index 47a0da40..8cf15c9a 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1206,8 +1206,7 @@ Wave WaveCopy(Wave wave) // NOTE: Security check in case of out-of-range void WaveCrop(Wave *wave, int initSample, int finalSample) { - if ((initSample >= 0) && (initSample < finalSample) && - (finalSample > 0) && ((unsigned int)finalSample < (wave->frameCount*wave->channels))) + if ((initSample >= 0) && (initSample < finalSample) && ((unsigned int)finalSample < (wave->frameCount*wave->channels))) { int sampleCount = finalSample - initSample; |
