IRC channel logs

2020-03-03.log

back to list of logs

<OriansJ>pder: thank you for the patch, it is applied and uploaded
<OriansJ>fossy: unfortunate when I introduce regressions but a solid justification for the question of what sort of fuzzing results should be included as tests. Short answer the ones users are likely to hit.
<fossy>right
<fossy>OriansJ: of course we are all human and all will introduce bugs
<xentrac>unless we don't introduce code!
<fossy>OriansJ: does this address all your concerns (new kaem.c) https://ttm.sh/E_N.txt
<fossy>please once again critically review
<OriansJ>fossy: in collect_comment; convert the if(EOF == c) into require(EOF != c, ..
<OriansJ>It'll make the function a little bit tighter
<OriansJ>in variable_substitute_ifset, you don't need postpend_char; as it callocs a whole copy of the string everytime you call it.
<OriansJ>just add an int i=0 and do var_name[i] = input[i]; and i = i + 1;
<OriansJ>move the check for : from variable_substitute and put it into variable_substitute_ifset; have it return TRUE if it did the work, otherwise return FALSE and then variable_substitute will know if it needs to execute
<OriansJ>you should probably break out the actual substitution into a seperate function
<OriansJ>that way it can be leveraged both times
<OriansJ>postpend_char is not the sort of thing you want in loops
<OriansJ>The collect_variable function doesn't support multiple variables in the same string but that might just be a design choice of yours
<OriansJ>in is_envar, it should be equal_found = TRUE;
<OriansJ>and I ran out of time for the rest, so I'll get back to it later
<OriansJ>good luck fossy
***deesix_ is now known as deesix
<deesix>fossy, in echo... What's the point of allocating if n ends up pointing somewhere else? struct Token* n = calloc(1, sizeof(struct Token)); n = token;
<deesix>Same thing in collect_command.
<deesix>About is_envar, I'd return TRUE when = is just found. The callers should check for TRUE instead of 1.
<deesix>I guess string_length is also not the sort of thing you want in loops either. But we can talk about this kind of optimizations later on.
<deesix>(more advanced compilers do the optimization for you, but M2-Planet does not)
<deesix>In main env calloc is not really checked (token is checked again instead).
<deesix>Lots of calloc are unchecked in fact, all around.
<deesix>I'm just starting to familiarize with kaem code, so this was not a proper review. Looking forward for your improvements!
<deesix>struct_to_array does like echo/collect_command: allocating only to overwrite the pointer in the next statement. Check for this weird pattern elsewhere. It's common to make the same mistake more than once, so everytime you fix a thing, it's wise to look for more instances of it.
<deesix>Why does escape handling in collect_token always drop the char after the slash? Is in only expecting a newline? This is not clear enough if that's the case.
<deesix>I can spot some typos, but we'll get there.
<deesix>... in comments.
<fossy><OriansJ> The collect_variable function doesn't support multiple variables in the same string but that might just be a design choice of yours
<fossy>That is correct for now
<fossy>thanks OriansJ, deesix, ill fix that up soonish
***Server sets mode: +cnt