Matthijs Kooijman
b2729a5156
Fix bounds check in String::remove()
...
Previously, if you passed in a very big index and/or count, the
`index + count` could overflow, making the count be used as-is instead
of being truncated (causing the string to be updated wrongly and
potentially writing to arbitrary memory locations).
We can rewrite the comparison to use `len - index` instead. Since we
know that index < len, we are sure this subtraction does not overflow,
regardless of what values of index and count we pass in.
As an added bonus, the `len - index` value already needed be calculated
inside the if, so this saves a few instructions in the generated code.
To illustrate this problem, consider this code:
String foo = "foo";
Serial.println(foo.length()); // Prints 3
foo.remove(1, 65535); // Should remove all but first character
Serial.println(foo.length()); // Prints 4 without this patch
Not shown in this is example is that some arbitrary memory is written
as well.
2014-09-10 12:33:25 +02:00
Matthijs Kooijman
dfb0dee773
Remove unneeded check in String::remove(unsigned int)
...
This check already happens in the remove(unsigned int, unsigned int)
method that is caled, so there is no need to also check this here.
2014-09-10 12:33:24 +02:00
Cristian Maglie
f02d637a89
Fixed license for new.cpp and small cosmetic changes
2014-09-06 12:44:53 +02:00
Cristian Maglie
a4496b927b
Correct implementation of gcc specific internal functions
...
The following empty stubs has been replaced by the gcc
flag -fno-threadsafe-static:
int __cxa_guard_acquire(__guard *);
void __cxa_guard_release (__guard *);
void __cxa_guard_abort (__guard *);
The following empty stubs has been moved into their specific
module abi.cpp:
void __cxa_pure_virtual(void) __attribute ((noreturn));
void __cxa_deleted_virtual(void) __attribute ((noreturn));
Fix #107
2014-09-06 12:42:25 +02:00
Cristian Maglie
df778925a8
Printable.h doesn't need new.h but only stdlib.h for size_t.
...
Probalby new.h may be removed completely.
2014-09-06 12:37:57 +02:00
Cristian Maglie
4801801ef9
Updated version to 1.5.8
2014-09-05 10:11:47 +02:00
Cristian Maglie
5d87f9e8e2
Merge branch 'master' into ide-1.5.x
2014-08-08 15:44:41 +02:00
Christopher Andrews
28acfd7d9d
Added replacement stub for cstdlib atexit() funciton.
...
This is an empty stub to simply allow use of complex types with a
non global static lifetime. For more complex handling the function
'atexit' can be redefined in user code.
For more information see:
https://github.com/arduino/Arduino/pull/2229
https://github.com/arduino/Arduino/issues/1919
2014-08-08 15:38:57 +02:00
PaulStoffregen
48f5256789
SPI Transactions for AVR
2014-08-01 05:38:27 -07:00
Cristian Maglie
e057236dd6
Merge remote-tracking branch 'arduino/master' into ide-1.5.x
2014-07-24 14:46:05 +02:00
Cristian Maglie
b06b62d2f7
Merge pull request #2206 from amulya349/master
...
Fix of a bug #2199
2014-07-24 14:40:52 +02:00
Amulya Kumar Sahoo
710bd1fa2e
Fix of a bug
2014-07-23 01:03:44 +05:30
Cristian Maglie
82a130f833
Merge pull request #2194 from Fede85/ide-1.5.x_lib-description
...
Ide 1.5.x lib description
2014-07-21 12:16:20 +02:00
Cristian Maglie
38e9fa1a5f
Merge pull request #2190 from ribbons/compiler-warnings
...
Fix two compiler warnings generated by updated toolchain
2014-07-19 09:35:58 +02:00
Fede85
6fb4b2795c
missing paragraph field in library.properties
2014-07-18 20:08:01 +02:00
Fede85
2f7cc5ff55
modified sentences in library.properties files
2014-07-18 19:41:34 +02:00
PaulStoffregen
bcc5488cbc
Add availableForWrite() to HardwareSerial
2014-07-18 07:01:26 -07:00
Matt Robinson
cd68a1c52c
Cast empty string to char* to fix compiler warning
...
Stream::find(char *target) passes an empty terminator string to
Stream::findUntil(char *target, char *terminator) which caused a compiler
warning with the updated toolchain, so cast it to a char*.
2014-07-17 16:51:35 +01:00
Cristian Maglie
cb4ae51b42
Merge pull request #1912 from Lauszus/issues440
...
Enable user to change the I2C clock frequency by calling setClock in the Wire library
2014-07-02 15:37:30 +02:00
Cristian Maglie
e7c3527a99
Merge pull request #2148 from Lauszus/promini
...
Arduino Pro and Pro Mini should use eightanaloginputs variant
2014-07-02 15:29:31 +02:00
Fede85
3bef9827bf
added support for the ArduinoISP
2014-07-02 15:03:12 +02:00
Cristian Maglie
1bc01d541e
Update ArduinoWifiShield_upgrade_mac.sh
2014-07-01 19:11:19 +02:00
Ankit Daftery
684e152fee
Update ArduinoWifiShield_upgrade.sh
...
File path should be updated, is wrong currently, will throw an error saying files missing.
2014-07-01 19:09:49 +02:00
Cristian Maglie
f4fad5f1a4
Merge branch 'master' into ide-1.5.x
2014-07-01 19:07:55 +02:00
Cristian Maglie
c9329f580a
Fixed permission on wifishield upgrade script.
2014-07-01 19:05:03 +02:00
Cristian Maglie
eabead0245
Merge pull request #2118 from benoit-artefactlabs/wifishield-upgrade-firmware-mac-path
...
corrected wrong path to firmware binaries in wifishield upgrade script f...
2014-07-01 18:52:41 +02:00
Cristian Maglie
5c9f875c3f
Merge branch 'master' into matthijskooijman-ide-1.5.x-timer-variant
...
Conflicts:
app/src/processing/app/debug/Compiler.java
hardware/arduino/sam/cores/arduino/main.cpp
2014-07-01 18:34:46 +02:00
Cristian Maglie
08f1010230
Merge branch 'ide-1.5.x-timer-variant' of github.com:matthijskooijman/Arduino into matthijskooijman-ide-1.5.x-timer-variant
2014-07-01 18:29:07 +02:00
Cristian Maglie
452cab0593
Merge pull request #2139 from cmaglie/init-variant
...
Allow variants to define an initVariant() function that is called at startup
2014-07-01 17:28:45 +02:00
Cristian Maglie
84bf36a96e
Reverting -flto flag from AVR core until all compatibility problems are worked out.
...
For more info:
https://groups.google.com/a/arduino.cc/d/msg/developers/21G5w2HbUOg/NRMW6c9OIFUJ
2014-07-01 17:18:04 +02:00
Cristian Maglie
a3989a494f
Merge branch 'master' into ide-1.5.x
2014-06-30 18:26:56 +02:00
Cristian Maglie
07ef56e3cb
Backported digitalPinToInterrupt macro from IDE 1.5.x
2014-06-30 18:24:08 +02:00
Kristian Lauszus
0c3ae05f59
Arduino Pro and Pro Mini should use eightanaloginputs variant, so all 8 analog pins can be used
2014-06-28 22:37:26 +02:00
Cristian Maglie
b4fc466b47
initVariant() is now declared as external "C" function.
...
See #2080 for more details.
2014-06-27 14:26:32 +02:00
Cristian Maglie
1decf99e10
Merge branch 'ide-1.5.7' into ide-1.5.x
2014-06-27 13:44:18 +02:00
Matthijs Kooijman
0d40e5cace
Support Atmega8 (and similar that define PE instead of UPE) again
...
These chips were previously supported, but since parity error checking
was added, this support has broken. Most chips define UPE0 (etc.) for
the parity error bit. Some chips don't have numbered UARTS so only
define UPE and even fewer define PE instead of UPE. This adds support
for those chips again.
Closes : #2137
2014-06-25 17:20:07 +02:00
Matthijs Kooijman
4fdf87c0e8
Allow variants to define an initVariant() function that is called at startup.
...
See #2080 and #2139 .
2014-06-25 16:56:19 +02:00
Cristian Maglie
8cf34fd737
Removed patch for old malloc bug (no more useful with updated toolchain)
2014-06-25 10:14:35 +02:00
Federico Fissore
29fce3601d
Fixed compilation error when targetting Mega. Error is caused by #2039 and this fix is just a workaround
2014-06-25 10:14:35 +02:00
Federico Fissore
3d2ebd3d8e
gcc: Adding -w flag to compiler.c.elf.flags in order to avoid printing ISR warning http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59396
2014-06-25 10:14:35 +02:00
Federico Fissore
4fd704a1a5
Enabling link-time optimization. See #660
2014-06-25 10:14:34 +02:00
Federico Fissore
64828ce62c
New common AVR toolchain
2014-06-25 10:12:39 +02:00
Cristian Maglie
7a31770a9a
Allow variants to define an initVariant() function that is called at startup.
...
See #2080
2014-06-19 19:49:47 +02:00
Cristian Maglie
55000f4b72
Merge branch 'master' into ide-1.5.x
2014-06-19 17:01:53 +02:00
Cristian Maglie
f599d51996
Fixed regression in USBAPI and CDC (xaljox)
...
See:
9ac7e30252 (commitcomment-6718676)
2014-06-19 16:52:48 +02:00
Cristian Maglie
fca64de387
Merge branch 'master' into HEAD
2014-06-13 10:29:12 +02:00
Embedded Micro
12219b37d5
Update USBAPI.h
...
Fixes bug where Serial.read() would always return 0 as the first byte.
2014-06-10 08:48:23 -07:00
benoit.git
42a544ee1b
corrected wrong path to firmware binaries in wifishield upgrade script for mac
2014-06-08 00:01:40 +02:00
Cristian Maglie
2d72650feb
Merge pull request #2104 from amulya349/master
...
Fix of a bug in Stream.cpp
2014-06-02 10:37:37 +02:00
Cristian Maglie
8bef5cdf03
Merge branch 'master' into HEAD
2014-05-30 10:54:14 +02:00