anchao commented on code in PR #15326: URL: https://github.com/apache/nuttx/pull/15326#discussion_r1898177781
########## libs/libc/misc/lib_tempbuffer.c: ########## @@ -63,58 +63,61 @@ static struct pathbuffer_s g_pathbuffer = ****************************************************************************/ /**************************************************************************** - * Name: lib_get_pathbuffer + * Name: lib_get_tempbuffer * * Description: - * The lib_get_pathbuffer() function returns a pointer to a temporary + * The lib_get_tempbuffer() function returns a pointer to a temporary * buffer. The buffer is allocated from a pool of pre-allocated buffers * and if the pool is exhausted, a new buffer is allocated through - * kmm_malloc(). The size of the buffer is PATH_MAX, and must freed by - * calling lib_put_pathbuffer(). + * kmm_malloc(). The size of the buffer is nbytes, and must freed by + * calling lib_put_tempbuffer(). * * Returned Value: - * On success, lib_get_pathbuffer() returns a pointer to a temporary + * On success, lib_get_tempbuffer() returns a pointer to a temporary * buffer. On failure, NULL is returned. * ****************************************************************************/ -FAR char *lib_get_pathbuffer(void) +FAR char *lib_get_tempbuffer(size_t nbytes) { - for (; ; ) + if (nbytes <= TEMP_MAX_SIZE) Review Comment: No, I think kernel code shouldn't pass this parameter, instead of fooling itself with a macro -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org