fixed 1-17 being wrong and unfinished
This commit is contained in:
		
							parent
							
								
									9e40e33700
								
							
						
					
					
						commit
						39604128b6
					
				
							
								
								
									
										7
									
								
								1-17.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								1-17.c
									
									
									
									
									
								
							| @ -8,8 +8,9 @@ int ggetline(char line[], int maxline){ | ||||
|     if(i<maxline-2){ | ||||
|       line[i]=c; | ||||
|     } | ||||
|     else if(i==maxline-1){ | ||||
|       line[i]='\0'; | ||||
|     else if(i==maxline-2){ | ||||
|       line[i]='\n'; | ||||
|       line[i++]='\0'; | ||||
|       return i; | ||||
|     } | ||||
|   } | ||||
| @ -31,7 +32,9 @@ int main(){ | ||||
|   char longline[MAXLINE]; /* line to print */ | ||||
|   while ((len = ggetline(line, MAXLINE)) >0){ | ||||
|     copy(longline, line); | ||||
|     if (len>80){ | ||||
|       printf("%s\n", longline); | ||||
|     } | ||||
|   } | ||||
|   return 0; | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user