Skip to content

Commit ea88bda

Browse files
author
Keyur Govande
committed
Fix typo with #elif. PHP strings don't work with size_t. Cast from size_t to int.
1 parent 2cc4c52 commit ea88bda

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sapi/cli/ps_title.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ extern char** environ;
109109
static char windows_error_details[64];
110110
static char ps_buffer[MAX_PATH];
111111
static const size_t ps_buffer_size = MAX_PATH;
112-
#elif PS_USE_CLOBBER_ARGV
112+
#elif defined(PS_USE_CLOBBER_ARGV)
113113
static char *ps_buffer; /* will point to argv area */
114114
static size_t ps_buffer_size; /* space determined at run time */
115115
#else
@@ -372,7 +372,7 @@ int set_ps_title(const char* title)
372372
* length into *displen.
373373
* The return code indicates the error.
374374
*/
375-
int get_ps_title(size_t *displen, const char** string)
375+
int get_ps_title(int *displen, const char** string)
376376
{
377377
int rc = is_ps_title_available();
378378
if (rc != PS_TITLE_SUCCESS)
@@ -382,7 +382,7 @@ int get_ps_title(size_t *displen, const char** string)
382382
if (!(ps_buffer_cur_len = GetConsoleTitle(ps_buffer, ps_buffer_size)))
383383
return PS_TITLE_WINDOWS_ERROR;
384384
#endif
385-
*displen = ps_buffer_cur_len;
385+
*displen = (int)ps_buffer_cur_len;
386386
*string = ps_buffer;
387387
return PS_TITLE_SUCCESS;
388388
}

sapi/cli/ps_title.h

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

3232
extern int set_ps_title(const char* new_str);
3333

34-
extern int get_ps_title(size_t* displen, const char** string);
34+
extern int get_ps_title(int* displen, const char** string);
3535

3636
extern const char* ps_title_errno(int rc);
3737

0 commit comments

Comments
 (0)