Do not cast away constness

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
Bart Van Assche
2020-02-28 21:45:12 -08:00
parent 3804f3c2e0
commit 529350eab1
3 changed files with 240 additions and 240 deletions

View File

@@ -37,7 +37,7 @@ iscsi_discovery_async(struct iscsi_context *iscsi, iscsi_command_cb cb,
void *private_data)
{
struct iscsi_pdu *pdu;
char *str;
const char *str;
pdu = iscsi_allocate_pdu(iscsi, ISCSI_PDU_TEXT_REQUEST,
ISCSI_PDU_TEXT_RESPONSE,
@@ -62,9 +62,9 @@ iscsi_discovery_async(struct iscsi_context *iscsi, iscsi_command_cb cb,
iscsi_pdu_set_ttt(pdu, 0xffffffff);
/* sendtargets */
str = (char *)"SendTargets=All";
if (iscsi_pdu_add_data(iscsi, pdu, (unsigned char *)str, strlen(str)+1)
!= 0) {
str = "SendTargets=All";
if (iscsi_pdu_add_data(iscsi, pdu, (const unsigned char *)str,
strlen(str) + 1) != 0) {
iscsi_set_error(iscsi, "Out-of-memory: pdu add data failed.");
iscsi->drv->free_pdu(iscsi, pdu);
return -1;