Changeset 4413
- Timestamp:
- 01/11/11 23:05:11 (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oscam-config.c
r4404 r4413 2274 2274 } 2275 2275 2276 if ( rdr->nagra_boxkey[0]&& isphysical)2276 if (check_filled(rdr->nagra_boxkey, 8) > 0 && isphysical) 2277 2277 fprintf_conf(f, CONFVARWIDTH, "boxkey", "%s\n", cs_hexdump(0, rdr->nagra_boxkey, 8)); 2278 2278 -
trunk/oscam-http-helpers.c
r4402 r4413 6 6 /* Adds a name->value-mapping or appends to it. You will get a reference back which you may freely 7 7 use (but you should not call free/realloc on this!)*/ 8 char *tpl_addVar(struct templatevars *vars, int append, char *name, char *value){ 8 char *tpl_addVar(struct templatevars *vars, int append, char *name, char *value){ 9 if(name == NULL || value == NULL) return ""; 9 10 int i; 10 11 char *tmp,*result = NULL; … … 52 53 it after having added the array here! */ 53 54 char *tpl_addTmp(struct templatevars *vars, char *value){ 55 if(value == NULL) return ""; 54 56 if((*vars).tmpalloc <= (*vars).tmpcnt){ 55 57 if(!cs_realloc (&(*vars).tmp, (*vars).tmpalloc * 2 * sizeof(char**), -1)) return value; … … 62 64 63 65 /* Allows to do a dynamic printf without knowing and defining the needed memory size. If you specify 64 varname, the printf-result will be added/appended to the varlist. You will always get a reference 65 back which you may freely use (but you should not call free/realloc on this!)*/ 66 varname, the printf-result will be added/appended to the varlist, if varname=NULL it will only be returned. 67 In either case you will always get a reference back which you may freely use (but you should not call 68 free/realloc on this as it will be automatically cleaned!)*/ 66 69 char *tpl_printf(struct templatevars *vars, int append, char *varname, char *fmtstring, ...){ 67 70 unsigned int needed; … … 149 152 char *pch; 150 153 if((strlen(path) + strlen(name) + 6) <= resultsize){ 151 strcpy(result, path); 152 strcat(result, name); 153 strcat(result, ".tpl"); 154 result[resultsize - 1] = '\0'; 154 snprintf(result, resultsize, "%s%s.tpl", path, name); 155 155 for(pch = result + strlen(path); pch[0] != '\0'; ++pch){ 156 156 if(pch[0] == '/' || pch[0] == '\\') pch[0] = ' '; -
trunk/oscam-simples.c
r4398 r4413 563 563 length specifies the maximum length to check for. */ 564 564 int check_filled(uchar *value, int length){ 565 if(value == NULL) return 0; 565 566 int i, j = 0; 566 567 for (i = 0; i < length; ++i){
Note:
See TracChangeset
for help on using the changeset viewer.