return output;
}
-char * format_euro(char * s, int cent){
+char * format_euro(char * s, int maxlen, int cent){
+ int tmp = cent;
+ int len = 5; // 1 char at least + 4 (== strlen(",EUR"))
+ while ((tmp/=10) > 0)
+ len++;
+ if (len>maxlen)
+ return NULL;
sprintf(s, "%d,%dEUR", cent/100, cent%100);
return s;
}
#define GENERAL_H_
typedef unsigned char BYTE;
char *get_input();
-char * format_euro(char * s, int cent);
+char * format_euro(char * s, int maxlen, int cent);
void c128_perror(BYTE, char*);
extern BYTE _oserror;
#endif /*GENERAL_H_*/