rec_put.c (14287) | rec_put.c (39327) |
---|---|
1/*- 2 * Copyright (c) 1990, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 74 unchanged lines hidden (view full) --- 83 * EINVAL. If it's short, pad it out. Use the record data return 84 * memory, it's only short-term. 85 */ 86 if (F_ISSET(t, R_FIXLEN) && data->size != t->bt_reclen) { 87 if (data->size > t->bt_reclen) 88 goto einval; 89 90 if (t->bt_rdata.size < t->bt_reclen) { | 1/*- 2 * Copyright (c) 1990, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 74 unchanged lines hidden (view full) --- 83 * EINVAL. If it's short, pad it out. Use the record data return 84 * memory, it's only short-term. 85 */ 86 if (F_ISSET(t, R_FIXLEN) && data->size != t->bt_reclen) { 87 if (data->size > t->bt_reclen) 88 goto einval; 89 90 if (t->bt_rdata.size < t->bt_reclen) { |
91 t->bt_rdata.data = t->bt_rdata.data == NULL ? 92 malloc(t->bt_reclen) : 93 realloc(t->bt_rdata.data, t->bt_reclen); | 91 t->bt_rdata.data = 92 reallocf(t->bt_rdata.data, t->bt_reclen); |
94 if (t->bt_rdata.data == NULL) 95 return (RET_ERROR); 96 t->bt_rdata.size = t->bt_reclen; 97 } 98 memmove(t->bt_rdata.data, data->data, data->size); 99 memset((char *)t->bt_rdata.data + data->size, 100 t->bt_bval, t->bt_reclen - data->size); 101 fdata.data = t->bt_rdata.data; --- 179 unchanged lines hidden --- | 93 if (t->bt_rdata.data == NULL) 94 return (RET_ERROR); 95 t->bt_rdata.size = t->bt_reclen; 96 } 97 memmove(t->bt_rdata.data, data->data, data->size); 98 memset((char *)t->bt_rdata.data + data->size, 99 t->bt_bval, t->bt_reclen - data->size); 100 fdata.data = t->bt_rdata.data; --- 179 unchanged lines hidden --- |