cyborg5 / IRLib2

Library for receiving, decoding, and sending infrared signals using Arduino
GNU General Public License v3.0
384 stars 138 forks source link

Integer overflow in IRLib_P08_Samsung36.h #14

Closed JohnWasser closed 6 years ago

JohnWasser commented 7 years ago
                 from /Users/john/Documents/Arduino/libraries/IRLib2/examples/dump/dump.ino:9:
/Users/john/Documents/Arduino/libraries/IRLibProtocols/IRLib_P08_Samsung36.h: In member function 'void IRsendSamsung36::send(uint32_t, uint32_t)':
/Users/john/Documents/Arduino/libraries/IRLibProtocols/IRLib_P08_Samsung36.h:53:12: warning: integer overflow in expression [-Woverflow]
   space(118*500);    //Lead out is 118 times the base time 500
            ^

118 500 = 59000 Too big for the default signed integer. Suggest changing to: ` space(118U500U); //Lead out is 118 times the base time 500`

pandaiolo commented 6 years ago

The fix is working for me, thanks

cyborg5 commented 6 years ago

Sorry I failed to notice this issue several months ago. I was in the hospital at the time. Fixed in the latest update.