]> git.cryptolib.org Git - arm-crypto-lib.git/blobdiff - test_src/string-extras.c
'hardening' infrastucture against toolchain bugs
[arm-crypto-lib.git] / test_src / string-extras.c
index 8f216c2daee6cc5c0b8adfad40a38fbd02611531..18cf67f6f5ced5fc8cbdc8d080ca1ff462bff334 100644 (file)
@@ -1,6 +1,6 @@
 /* string_extras.c */
 /*
-    This file is part of the AVR-Crypto-Lib.
+    This file is part of the ARM-Crypto-Lib.
     Copyright (C) 2008  Daniel Otte (daniel.otte@rub.de)
 
     This program is free software: you can redistribute it and/or modify
@@ -96,7 +96,11 @@ char* ultoa(unsigned long a, char* buffer, uint8_t radix){
                return buffer;
        }
        while(a){
+               /* toolchain bug??
                result = div(a, radix);
+               */
+               result.quot = a/radix;
+               result.rem = a%radix;
                *ptr = result.rem;
                if(result.rem<10){
                        *ptr += '0';