|
|
@ -77,18 +77,16 @@ void collectCustomerProperties() |
|
|
|
printf("Enter balance (max. 10 digits):\n"); |
|
|
|
char *balanceCharacters = calloc(10+1+1+1,sizeof(char)); |
|
|
|
letterMaximum = 10; |
|
|
|
while(letterCounter<letterMaximum && (userInput=getchar())!='\n'){ |
|
|
|
while(letterCounter<=letterMaximum && (userInput=getchar())!='\n'){ |
|
|
|
*(balanceCharacters+letterCounter) = userInput; |
|
|
|
++letterCounter; |
|
|
|
if(letterCounter>=letterMaximum){ |
|
|
|
if(letterCounter>letterMaximum){ |
|
|
|
inputTooLong = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if(inputTooLong){ |
|
|
|
puts("Input too long."); |
|
|
|
exit(-1); |
|
|
|
//call errorMessage(-10); |
|
|
|
errorMessage(-12); |
|
|
|
}else{ |
|
|
|
if(!foundComma){ |
|
|
|
*(balanceCharacters+letterCounter) = '.'; |
|
|
|