[Bug] Claude off by one error when implementing suggestions
Bug Description
I got the following options
Must Fix Immediately:
- ✅ Fix topic name: /status → /data (line 742)
- ✅ Fix LCD subscription topic to include MCU_FAMILY (line 554)
- ✅ Fix memory leak in randClientId()
- ✅ Enable OTA password authentication
- ✅ Add timeout for mail mode deep sleep
Should Fix:
- Replace all strcpy/strcat with snprintf()
- Add loop delay to LCD mode
- Fix float/int confusion in battery voltage calculation
- Remove or implement flickBuiltinLed()
Nice to Have:
- Refactor globals into structs
- Remove magic numbers
- Add better error handling for sensors
- Increase MQTT buffer size
Would you like me to create a fixed version of the critical bugs, or would you prefer to tackle these one at a time?
do 3
⏺ I'll fix issue #3 - the LCD subscription bug where the topic is missing the MCU_FAMILY prefix.
as You can see the claude start doing number 2 .
number 3 was memory leak !
3 was Fix memory leak in randClientId() - the one that you tried is 2 - off by one error, a bug that should be reported to claude !
⏺ You're absolutely right! I made an off-by-one error - I did #2 when you asked for #3. Sorry about that! And yes, that's a bug worth reporting.
😅
Let me fix #3: Memory leak in randClientId()
The problem is on lines 122-136 where memory is allocated with new but never freed, plus line 511 allocates another buffer that's also never
freed.
Environment Info
- Platform: darwin
- Terminal: iTerm.app
- Version: 2.0.24
- Feedback ID: c8ef1a5a-3062-4c5c-998a-b231dbd758c9
Errors
[]This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗