fix: error read float value and indent level
This commit is contained in:
		
							parent
							
								
									5a494e53c5
								
							
						
					
					
						commit
						3fe193ebca
					
				| 
						 | 
					@ -369,7 +369,7 @@ int argo_read_number(ARGO_NUMBER *n, FILE *f)
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    float_value = float_value + 10 + (c - '0');
 | 
					                    float_value = float_value * 10 + (c - '0');
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -949,6 +949,10 @@ int argo_write_object(ARGO_VALUE *o, FILE *f)
 | 
				
			||||||
    indent_level--;
 | 
					    indent_level--;
 | 
				
			||||||
    print_indent(f);
 | 
					    print_indent(f);
 | 
				
			||||||
    fprintf(f, "}");
 | 
					    fprintf(f, "}");
 | 
				
			||||||
 | 
					    if (indent_level == 0)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        fprintf(f, "\n");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -971,6 +975,11 @@ int argo_write_array(ARGO_VALUE *a, FILE *f)
 | 
				
			||||||
    indent_level--;
 | 
					    indent_level--;
 | 
				
			||||||
    print_indent(f);
 | 
					    print_indent(f);
 | 
				
			||||||
    fprintf(f, "]");
 | 
					    fprintf(f, "]");
 | 
				
			||||||
 | 
					    if (indent_level == 0)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        fprintf(f, "\n");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -53,8 +53,6 @@ int main(int argc, char **argv)
 | 
				
			||||||
        if (argo_write_value(json, stdout)) {
 | 
					        if (argo_write_value(json, stdout)) {
 | 
				
			||||||
            return EXIT_FAILURE;
 | 
					            return EXIT_FAILURE;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        fprintf(stdout, "\n");
 | 
					 | 
				
			||||||
        return EXIT_SUCCESS;
 | 
					        return EXIT_SUCCESS;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    // TO BE IMPLEMENTED
 | 
					    // TO BE IMPLEMENTED
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user