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