Skip to content

Commit 4710977

Browse files
committed
Revert "Fix pulling string samples with embedded NULL bytes"
This reverts commit b3c5886.
1 parent 21d943f commit 4710977

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lsl_inlet_c.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ LIBLSL_C_API double lsl_pull_sample_str(
116116
if (ec) *ec = lsl_internal_error;
117117
return 0.0;
118118
}
119-
memcpy(buffer[k], tmp[k].c_str(), tmp[k].size());
119+
strcpy(buffer[k], tmp[k].c_str());
120120
}
121121
return result;
122122
} LSL_STORE_EXCEPTION_IN(ec)
@@ -218,7 +218,7 @@ LIBLSL_C_API unsigned long lsl_pull_chunk_str(lsl_inlet in, char **data_buffer,
218218
if (ec) *ec = lsl_internal_error;
219219
return 0;
220220
}
221-
memcpy(data_buffer[k], tmp[k].c_str(), tmp[k].size());
221+
strcpy(data_buffer[k], tmp[k].c_str());
222222
}
223223
return result;
224224
} else
@@ -246,7 +246,7 @@ LIBLSL_C_API unsigned long lsl_pull_chunk_buf(lsl_inlet in, char **data_buffer,
246246
return 0;
247247
}
248248
lengths_buffer[k] = (uint32_t)tmp[k].size();
249-
memcpy(data_buffer[k], tmp[k].c_str(), tmp[k].size());
249+
strcpy(data_buffer[k], tmp[k].c_str());
250250
}
251251
return result;
252252
} else

0 commit comments

Comments
 (0)