apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: apr/threadproc/win32 proc.c
Date Mon, 10 Sep 2001 19:45:05 GMT
brane       01/09/10 12:45:05

  Modified:    threadproc/win32 proc.c
  Log:
  (apr_proc_create): Fix bug in conversion of program name to Unicode on
  WinNT: utf8_to_unicode_path needs more space than just the program length.
  Use a fixed-size buffer for the program name, like everywhere else.
  
  Revision  Changes    Path
  1.49      +3 -3      apr/threadproc/win32/proc.c
  
  Index: proc.c
  ===================================================================
  RCS file: /home/cvs/apr/threadproc/win32/proc.c,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- proc.c	2001/09/09 06:03:05	1.48
  +++ proc.c	2001/09/10 19:45:05	1.49
  @@ -420,14 +420,14 @@
       if (os_level >= APR_WIN_NT)
       {
           STARTUPINFOW si;
  -        apr_size_t nprg = strlen(progname) + 1;
  +        apr_wchar_t wprg[APR_PATH_MAX];
           apr_size_t ncmd = strlen(cmdline) + 1, nwcmd = ncmd;
           apr_size_t ncwd = strlen(attr->currdir) + 1, nwcwd = ncwd;
  -        apr_wchar_t *wprg = apr_palloc(cont, nprg * 2);
           apr_wchar_t *wcmd = apr_palloc(cont, ncmd * 2);
           apr_wchar_t *wcwd = apr_palloc(cont, ncwd * 2);
   
  -        if (((rv = utf8_to_unicode_path(wprg, &nprg, progname)) 
  +        if (((rv = utf8_to_unicode_path(wprg, sizeof(wprg)/sizeof(wprg[0]),
  +                                        progname))
                       != APR_SUCCESS)
            || ((rv = conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd)) 
                       != APR_SUCCESS)
  
  
  

Mime
View raw message