--------------------------------------------------------------------* * Copy in memory * *--------------------------------------------------------------------*/ ! * \brief l_binaryCopy() * * \param[in] datas * \param[in] size of data array * \return datad on heap, or NULL on error * * * Notes: * (1) We add 4 bytes t
| 1466 | * </pre> |
| 1467 | */ |
| 1468 | l_uint8 * |
| 1469 | l_binaryCopy(l_uint8 *datas, |
| 1470 | size_t size) |
| 1471 | { |
| 1472 | l_uint8 *datad; |
| 1473 | |
| 1474 | PROCNAME("l_binaryCopy"); |
| 1475 | |
| 1476 | if (!datas) |
| 1477 | return (l_uint8 *)ERROR_PTR("datas not defined", procName, NULL); |
| 1478 | |
| 1479 | if ((datad = (l_uint8 *)LEPT_CALLOC(size + 4, sizeof(l_uint8))) == NULL) |
| 1480 | return (l_uint8 *)ERROR_PTR("datad not made", procName, NULL); |
| 1481 | memcpy(datad, datas, size); |
| 1482 | return datad; |
| 1483 | } |
| 1484 | |
| 1485 | |
| 1486 | /*--------------------------------------------------------------------* |
no outgoing calls
no test coverage detected