Well, lets look at this one then:
Code:
char* breakSmart(char* A, int n, int m, int* costs){
char* formatted = malloc(sizeof(char)); char* not = A; char* rFormat; char* tempNot; int j; int inLength, rLength;
if (n > m)
while ((inLength = length(not)) > m){
j = inLength;
while (not[j] != '\n' && not[j] != ' ') j--;
not[j] = '\n';rLength = inLength-j;
rFormat = malloc(sizeof(char)*rLength); int r;
for (r=j+1; r<=inLength; r++)
rFormat[r] = not[r];
}
For some weir reason rFormat ends up with nothing, although not/A contains for them.