diff --git a/osd-target/mtq.c b/osd-target/mtq.c index 0252b3d..74cfc0b 100644 --- a/osd-target/mtq.c +++ b/osd-target/mtq.c @@ -94,7 +94,7 @@ int mtq_run_query(struct db_context *dbc, uint64_t pid, uint64_t cid, " WHERE coll.pid = coll.pid AND coll.oid = attr.oid AND " " coll.pid = %llu AND coll.cid = %llu ", coll, attr, llu(pid), llu(cid)); - sprintf(cp, select_stmt); + strncpy(cp, select_stmt, MAXSQLEN*factor); sqlen += strlen(cp); cp += sqlen; for (i = 0; i < qc->qc_cnt; i++) { diff --git a/osd-target/osd-sense.c b/osd-target/osd-sense.c index 0bf3fa0..f5daaa0 100644 --- a/osd-target/osd-sense.c +++ b/osd-target/osd-sense.c @@ -59,7 +59,7 @@ static int sense_info_build(uint8_t *data, int len, uint32_t not_init_funcs, set_htonl(&data[12], completed_funcs); set_htonll(&data[16], pid); set_htonll(&data[24], oid); - osd_warning(" identification pid=%lx oid=%lx",pid, oid); + osd_warning(" identification pid=%llx oid=%llx",pid, oid); return 32; } @@ -73,7 +73,7 @@ static int sense_csi_build(uint8_t *data, int len, uint64_t csi) data[0] = 0x1; data[1] = 0xa; set_htonll(&data[4], csi); - osd_warning(" command-specific information=%lx",csi); + osd_warning(" command-specific information=%llx",csi); return 12; } diff --git a/osd-target/osd.c b/osd-target/osd.c index 948c08a..6e280a5 100644 --- a/osd-target/osd.c +++ b/osd-target/osd.c @@ -956,7 +956,7 @@ static int osd_initialize_db(struct osd_device *osd) /* set root object attributes */ for (i=0; idbc, ROOT_PID , ROOT_OID, ia->page, ia->number, ia->s, strlen(ia->s)+1); if (ret != SQLITE_OK) @@ -969,7 +969,7 @@ static int osd_initialize_db(struct osd_device *osd) * are different. */ for (i=0; idbc, ROOT_PID, ROOT_OID, ia->page, ia->number, ia->s, strlen(ia->s)+1); if (ret) @@ -2532,7 +2532,7 @@ int osd_list(struct osd_device *osd, uint8_t list_attr, uint64_t pid, add_len = (uint64_t) -1; set_htonll(outdata, add_len); set_htonll(&outdata[8], cont_id); -osd_error("%s: add_len=%lu cont_id=0x%lx", __func__, add_len, cont_id); +osd_error("%s: add_len=%llu cont_id=0x%llx", __func__, add_len, cont_id); } else if (list_attr == 1 && get_attr->sz != 0 && pid != 0) { if (list_id) initial_oid = cont_id;