Skip to content

Commit 9a7d37a

Browse files
committed
Use size_t for get_ps_title() length parameter
1 parent b468d6f commit 9a7d37a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

sapi/cli/php_cli_process_title.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ PHP_FUNCTION(cli_set_process_title)
4646
/* {{{ Return a string with the current process title. NULL if error. */
4747
PHP_FUNCTION(cli_get_process_title)
4848
{
49-
int length = 0;
49+
size_t length = 0;
5050
const char* title = NULL;
5151
int rc;
5252

sapi/cli/ps_title.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ int set_ps_title(const char* title)
395395
* length into *displen.
396396
* The return code indicates the error.
397397
*/
398-
int get_ps_title(int *displen, const char** string)
398+
int get_ps_title(size_t *displen, const char** string)
399399
{
400400
int rc = is_ps_title_available();
401401
if (rc != PS_TITLE_SUCCESS)
@@ -421,7 +421,7 @@ int get_ps_title(int *displen, const char** string)
421421
free(tmp);
422422
}
423423
#endif
424-
*displen = (int)ps_buffer_cur_len;
424+
*displen = ps_buffer_cur_len;
425425
*string = ps_buffer;
426426
return PS_TITLE_SUCCESS;
427427
}

sapi/cli/ps_title.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern char** save_ps_args(int argc, char** argv);
2727

2828
extern int set_ps_title(const char* new_str);
2929

30-
extern int get_ps_title(int* displen, const char** string);
30+
extern int get_ps_title(size_t* displen, const char** string);
3131

3232
extern const char* ps_title_errno(int rc);
3333

0 commit comments

Comments
 (0)