Minor fixes
authorZdeněk Šustr <sustr4@cesnet.cz>
Thu, 9 Aug 2012 14:50:41 +0000 (14:50 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Thu, 9 Aug 2012 14:50:41 +0000 (14:50 +0000)
org.glite.lb.common/src/query_rec.c
org.glite.lb.server/src/bkserverd.c
org.glite.lbjp-common.trio/src/escape.c

index 799ed48..6cfb1c5 100644 (file)
@@ -90,6 +90,7 @@ void edg_wll_QueryRecFree(edg_wll_QueryRec *prec)
 
 #ifdef GLITE_LB_QUERY_REC_TEST
 int main() {
+       // These assertions fail if the contents of edg_wll_QueryAttrNames[] are not synced with _edg_wll_QueryAttr
        assert(sizeof(edg_wll_QueryAttrNames) / sizeof(edg_wll_QueryAttrNames[0]) == EDG_WLL_QUERY_ATTR__LAST);
        assert(sizeof(edg_wll_QueryOpNames) / sizeof(edg_wll_QueryOpNames[0]) == EDG_WLL_QUERY_OP__LAST);
 
index 0b93f74..28b0690 100644 (file)
@@ -592,7 +592,7 @@ int main(int argc, char *argv[])
        }
        if (html_header) {
                char *et, *ed;
-               FILE *fp = fopen("file","r");
+               FILE *fp = fopen(html_header, "r");
                if( fp ) {
                        fclose(fp);
                        glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_DEBUG, "Using HTML header file %s", html_header);
index 4e81b5b..61a76d9 100644 (file)
@@ -318,7 +318,7 @@ char *glite_lbu_UnescapeURL(const char *in) {
        unsigned int val;
 
        if(!in) return NULL;
-       out = (char*)calloc(strlen(in), sizeof(char));
+       out = (char*)calloc(strlen(in)+1, sizeof(char));
 
        strncpy(out, spec, strcspn(spec, "%")); // Copy the first part of the string up to the first '%'