}
char body[1025];
- memset(body,0,1025);
+ memset(body, '\0', sizeof(body));
buffer = buffer_init(1025);
while(ap_get_client_block(r, body, 1024)) {
buffer_add( buffer, body );
- memset(body,0,1025);
+ memset(body, '\0', sizeof(body));
}
if(arg && arg[0]) {
if(href[0] != '/') {
int len = strlen(ctx->xmlFile) + strlen(href) + 1;
char buf[len];
- bzero(buf, len);
+ memset( buf, '\0', sizeof(len) );
strcpy( buf, ctx->xmlFile );
int i;
for( i = strlen(buf); i != 0; i-- ) {
if( prop[0] == '&' && prop[nl-1] == ';' ) { /* replace the entity if we are one */
char buf[nl+1];
- bzero(buf, nl+1);
+ memset( buf, '\0', sizeof(buf) );
strncat(buf, prop + 1, nl - 2);
xmlEntityPtr ent = osrfHashGet( ctx->entHash, buf );
if(ent && ent->content) _prop = ent->content;
/* determine the path to the DTD file and load it */
int len = strlen(context->config->baseDir) + strlen(locale) + strlen(sysId) + 4;
- char buf[len]; bzero(buf,len);
- snprintf( buf, len, "%s/%s/%s", context->config->baseDir, locale, sysId );
+ char buf[len];
+ snprintf( buf, sizeof(buf), "%s/%s/%s", context->config->baseDir, locale, sysId );
xmlDtdPtr dtd = xmlParseDTD(NULL, buf);
if(!dtd) return;
static void XMLCALL charHandler( void* userData, const XML_Char* s, int len ) {
ap_filter_t* filter = (ap_filter_t*) userData;
char data[len+1];
- bzero(data, len+1);
+ memset( data, '\0', sizeof(data) );
memcpy( data, s, len );
xmlEntConfig* config = ap_get_module_config(
case DBI_TYPE_DATETIME :
- memset(dt_string, '\0', 256);
+ memset(dt_string, '\0', sizeof(dt_string));
memset(&gmdt, '\0', sizeof(gmdt));
memset(&_tmp_dt, '\0', sizeof(_tmp_dt));
case DBI_TYPE_DATETIME :
- memset(dt_string, '\0', 256);
+ memset(dt_string, '\0', sizeof(dt_string));
memset(&gmdt, '\0', sizeof(gmdt));
memset(&_tmp_dt, '\0', sizeof(_tmp_dt));
jsonObjectSetKey( json, "pid", jsonNewNumberObject(getpid()) );
char buf[256];
- memset(buf,0, 256);
- snprintf(buf, 256, "%s:%d", event->file, event->line);
+ memset(buf, '\0', sizeof(buf));
+ snprintf(buf, sizeof(buf), "%s:%d", event->file, event->line);
jsonObjectSetKey( json, "stacktrace", jsonNewObject(buf) );
if(event->perm) jsonObjectSetKey( json, "ilsperm", jsonNewObject(event->perm) );
osrfHashSet( fmClassMap, hint, apiname );
char method[256];
- bzero(method, 256);
- snprintf(method, 256, "open-ils.fetch.%s.retrieve", apiname);
+ snprintf(method, sizeof(method), "open-ils.fetch.%s.retrieve", apiname);
osrfAppRegisterMethod( MODULENAME,
method, "oilsFetchDoRetrieve", "", 1, 0 );
/* construct the SQL */
char sql[256];
- bzero(sql, 256);
- snprintf( sql, 255, "select * from %s.%s where id = %s;", schema, object, id );
+ snprintf( sql, sizeof(sql), "select * from %s.%s where id = %s;", schema, object, id );
/* find the object hint from the api name */
char hintbuf[256];
- bzero(hintbuf,256);
- snprintf(hintbuf, 255, "%s.%s", schema, object );
+ snprintf(hintbuf, sizeof(hintbuf), "%s.%s", schema, object );
char* hint = osrfHashGet( fmClassMap, hintbuf );
osrfLogDebug(OSRF_LOG_MARK, "%s SQL = %s", MODULENAME, sql);
char* seed = jsonObjectGetString(o);
char* passhash = md5sum(passwd);
char buf[256];
- bzero(buf, 256);
- snprintf(buf, 255, "%s%s", seed, passhash);
+ snprintf(buf, sizeof(buf), "%s%s", seed, passhash);
char* fullhash = md5sum(buf);
jsonObjectFree(o);