Skip to content

Commit

Permalink
Fix typo with #elif. PHP strings don't work with size_t. Cast from si…
Browse files Browse the repository at this point in the history
…ze_t to int.
  • Loading branch information
Keyur Govande committed Feb 26, 2013
1 parent 2cc4c52 commit ea88bda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions sapi/cli/ps_title.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ extern char** environ;
static char windows_error_details[64];
static char ps_buffer[MAX_PATH];
static const size_t ps_buffer_size = MAX_PATH;
#elif PS_USE_CLOBBER_ARGV
#elif defined(PS_USE_CLOBBER_ARGV)
static char *ps_buffer; /* will point to argv area */
static size_t ps_buffer_size; /* space determined at run time */
#else
Expand Down Expand Up @@ -372,7 +372,7 @@ int set_ps_title(const char* title)
* length into *displen.
* The return code indicates the error.
*/
int get_ps_title(size_t *displen, const char** string)
int get_ps_title(int *displen, const char** string)
{
int rc = is_ps_title_available();
if (rc != PS_TITLE_SUCCESS)
Expand All @@ -382,7 +382,7 @@ int get_ps_title(size_t *displen, const char** string)
if (!(ps_buffer_cur_len = GetConsoleTitle(ps_buffer, ps_buffer_size)))
return PS_TITLE_WINDOWS_ERROR;
#endif
*displen = ps_buffer_cur_len;
*displen = (int)ps_buffer_cur_len;
*string = ps_buffer;
return PS_TITLE_SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion sapi/cli/ps_title.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extern char** save_ps_args(int argc, char** argv);

extern int set_ps_title(const char* new_str);

extern int get_ps_title(size_t* displen, const char** string);
extern int get_ps_title(int* displen, const char** string);

extern const char* ps_title_errno(int rc);

Expand Down

0 comments on commit ea88bda

Please sign in to comment.