atoi, for kill
This commit is contained in:
		
							parent
							
								
									e0924827ee
								
							
						
					
					
						commit
						e204d0a151
					
				
					 2 changed files with 12 additions and 0 deletions
				
			
		
							
								
								
									
										11
									
								
								ulib.c
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								ulib.c
									
										
									
									
									
								
							|  | @ -88,3 +88,14 @@ stat(char *n, struct stat *st) | |||
|   close(fd); | ||||
|   return r; | ||||
| } | ||||
| 
 | ||||
| int | ||||
| atoi(const char *s) | ||||
| { | ||||
|   int n; | ||||
| 
 | ||||
|   n = 0; | ||||
|   while('0' <= *s && *s <= '9') | ||||
|     n = n*10 + *s++ - '0'; | ||||
|   return n; | ||||
| } | ||||
|  |  | |||
							
								
								
									
										1
									
								
								user.h
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								user.h
									
										
									
									
									
								
							|  | @ -31,3 +31,4 @@ unsigned int strlen(char*); | |||
| void* memset(void*, int, unsigned int); | ||||
| void* malloc(uint); | ||||
| void free(void*); | ||||
| int atoi(const char*); | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue