necouchman commented on code in PR #470:
URL: https://github.com/apache/guacamole-server/pull/470#discussion_r1437863920


##########
src/libguac/string.c:
##########
@@ -44,6 +45,22 @@
  */
 #define REMAINING(n, length) (((n) < (length)) ? 0 : ((n) - (length)))
 
+size_t guac_itoa(char* restrict dest, int integer) {
+
+    /* Make sure memory is cleared. */
+    guac_mem_free(dest);

Review Comment:
   Yeah, that's a fair point. I could remove the freeing, but then I'd also 
have to remove the automatic allocation, and make the assumption that the 
caller has already allocated the correct amount of memory, right? I was trying 
to roll as much of that into this "convenience" function as possible, but I'm 
open to other suggestions if that makes sense.
   
   From what little I can gather, it isn't possible to detect if something is 
heap or stack allocated?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to