Use size_t for get_ps_title() length parameter

This commit is contained in:
George Peter Banyard 2022-06-30 12:36:12 +01:00
parent b468d6fb54
commit 9a7d37ac66
No known key found for this signature in database
GPG Key ID: 3306078E3194AEBD
3 changed files with 4 additions and 4 deletions

View File

@ -46,7 +46,7 @@ PHP_FUNCTION(cli_set_process_title)
/* {{{ Return a string with the current process title. NULL if error. */
PHP_FUNCTION(cli_get_process_title)
{
int length = 0;
size_t length = 0;
const char* title = NULL;
int rc;

View File

@ -395,7 +395,7 @@ int set_ps_title(const char* title)
* length into *displen.
* The return code indicates the error.
*/
int get_ps_title(int *displen, const char** string)
int get_ps_title(size_t *displen, const char** string)
{
int rc = is_ps_title_available();
if (rc != PS_TITLE_SUCCESS)
@ -421,7 +421,7 @@ int get_ps_title(int *displen, const char** string)
free(tmp);
}
#endif
*displen = (int)ps_buffer_cur_len;
*displen = ps_buffer_cur_len;
*string = ps_buffer;
return PS_TITLE_SUCCESS;
}

View File

@ -27,7 +27,7 @@ extern char** save_ps_args(int argc, char** argv);
extern int set_ps_title(const char* new_str);
extern int get_ps_title(int* displen, const char** string);
extern int get_ps_title(size_t* displen, const char** string);
extern const char* ps_title_errno(int rc);