Changeset 281

Show
Ignore:
Timestamp:
06/02/10 12:42:31 (20 months ago)
Author:
ol
Message:

Fix null end char in query string. Some improvements on query handle for fastcgi

Location:
trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/ows/ows.c

    r279 r281  
    305305{ 
    306306    ows *o; 
    307     char *query=NULL; 
     307    char *query; 
    308308 
    309309    o = ows_init(); 
     
    335335#endif 
    336336 
     337    query=NULL; 
    337338    if (!o->exit) query = cgi_getback_query(o); 
     339 
     340    /* Log input query if asked */ 
     341   if (o->log && query) 
     342        fprintf(o->log, "[QUERY]\n%s\n", query); 
    338343 
    339344    if (query == NULL || strlen(query) == 0) { 
     
    361366        } 
    362367    }  
    363  
    364     /* Log input query if asked */ 
    365    if (o->log && query) 
    366         fprintf(o->log, "[QUERY]\n%s\n", query); 
    367368 
    368369    if (!o->exit) o->request = ows_request_init(); 
     
    410411        o->request=NULL; 
    411412    } 
    412  
     413     
    413414#if TINYOWS_FCGI 
    414415    if (o->log) fprintf(o->log, "---\n");  
  • trunk/src/struct/cgi_request.c

    r278 r281  
    9292        assert(query != NULL); 
    9393        result = fread(query, query_size, 1, stdin); 
     94        query[query_size] = '\0'; 
    9495    } 
    9596    /* local tests */