libusb20_desc.c (189587) | libusb20_desc.c (199055) |
---|---|
1/* $FreeBSD: head/lib/libusb/libusb20_desc.c 186730 2009-01-04 00:12:01Z alfred $ */ | 1/* $FreeBSD: head/lib/libusb/libusb20_desc.c 199055 2009-11-08 20:03:52Z thompsa $ */ |
2/*- 3 * Copyright (c) 2008 Hans Petter Selasky. 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 9 * notice, this list of conditions and the following disclaimer. --- 103 unchanged lines hidden (view full) --- 113 (niface * sizeof(*lub_interface)) + 114 (nendpoint * sizeof(*lub_endpoint)) + 115 pcdesc.len; 116 117 lub_config = malloc(size); 118 if (lub_config == NULL) { 119 return (NULL); /* out of memory */ 120 } | 2/*- 3 * Copyright (c) 2008 Hans Petter Selasky. 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 9 * notice, this list of conditions and the following disclaimer. --- 103 unchanged lines hidden (view full) --- 113 (niface * sizeof(*lub_interface)) + 114 (nendpoint * sizeof(*lub_endpoint)) + 115 pcdesc.len; 116 117 lub_config = malloc(size); 118 if (lub_config == NULL) { 119 return (NULL); /* out of memory */ 120 } |
121 /* make sure memory is initialised */ 122 memset(lub_config, 0, size); 123 |
|
121 lub_interface = (void *)(lub_config + 1); 122 lub_alt_interface = (void *)(lub_interface + niface_no_alt); 123 lub_endpoint = (void *)(lub_interface + niface); 124 125 /* 126 * Make a copy of the config descriptor, so that the caller can free 127 * the inital config descriptor pointer! 128 */ --- 657 unchanged lines hidden --- | 124 lub_interface = (void *)(lub_config + 1); 125 lub_alt_interface = (void *)(lub_interface + niface_no_alt); 126 lub_endpoint = (void *)(lub_interface + niface); 127 128 /* 129 * Make a copy of the config descriptor, so that the caller can free 130 * the inital config descriptor pointer! 131 */ --- 657 unchanged lines hidden --- |