bsm_io.c (187214) | bsm_io.c (189279) |
---|---|
1/*- 2 * Copyright (c) 2004-2008 Apple Inc. 3 * Copyright (c) 2005 SPARTA, Inc. 4 * Copyright (c) 2006 Robert N. M. Watson 5 * Copyright (c) 2006 Martin Voros 6 * All rights reserved. 7 * 8 * This code was developed in part by Robert N. M. Watson, Senior Principal --- 18 unchanged lines hidden (view full) --- 27 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 31 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 * POSSIBILITY OF SUCH DAMAGE. 34 * | 1/*- 2 * Copyright (c) 2004-2008 Apple Inc. 3 * Copyright (c) 2005 SPARTA, Inc. 4 * Copyright (c) 2006 Robert N. M. Watson 5 * Copyright (c) 2006 Martin Voros 6 * All rights reserved. 7 * 8 * This code was developed in part by Robert N. M. Watson, Senior Principal --- 18 unchanged lines hidden (view full) --- 27 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 31 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 * POSSIBILITY OF SUCH DAMAGE. 34 * |
35 * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#60 $ | 35 * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#61 $ |
36 */ 37 38#include <sys/types.h> 39 40#include <config/config.h> 41#if defined(HAVE_SYS_ENDIAN_H) && defined(HAVE_BE32ENC) 42#include <sys/endian.h> 43#else /* !HAVE_SYS_ENDIAN_H || !HAVE_BE32ENC */ --- 144 unchanged lines hidden (view full) --- 188static void 189print_mem(FILE *fp, u_char *data, size_t len) 190{ 191 u_int32_t i; 192 193 if (len > 0) { 194 fprintf(fp, "0x"); 195 for (i = 0; i < len; i++) | 36 */ 37 38#include <sys/types.h> 39 40#include <config/config.h> 41#if defined(HAVE_SYS_ENDIAN_H) && defined(HAVE_BE32ENC) 42#include <sys/endian.h> 43#else /* !HAVE_SYS_ENDIAN_H || !HAVE_BE32ENC */ --- 144 unchanged lines hidden (view full) --- 188static void 189print_mem(FILE *fp, u_char *data, size_t len) 190{ 191 u_int32_t i; 192 193 if (len > 0) { 194 fprintf(fp, "0x"); 195 for (i = 0; i < len; i++) |
196 fprintf(fp, "%x", data[i]); | 196 fprintf(fp, "%02x", data[i]); |
197 } 198} 199 200/* 201 * Prints the given data bytes as a string. 202 */ 203static void 204print_string(FILE *fp, const char *str, size_t len) --- 4349 unchanged lines hidden --- | 197 } 198} 199 200/* 201 * Prints the given data bytes as a string. 202 */ 203static void 204print_string(FILE *fp, const char *str, size_t len) --- 4349 unchanged lines hidden --- |