citrus_iconv.c (263986) | citrus_iconv.c (267437) |
---|---|
1/* $FreeBSD: head/lib/libc/iconv/citrus_iconv.c 263986 2014-04-01 10:36:11Z tijl $ */ | 1/* $FreeBSD: head/lib/libc/iconv/citrus_iconv.c 267437 2014-06-13 08:28:51Z tijl $ */ |
2/* $NetBSD: citrus_iconv.c,v 1.10 2011/11/19 18:34:21 tnozaki Exp $ */ 3 4/*- 5 * Copyright (c)2003 Citrus Project, 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 329 unchanged lines hidden (view full) --- 339 } 340} 341 342const char 343*_citrus_iconv_canonicalize(const char *name) 344{ 345 char *buf; 346 | 2/* $NetBSD: citrus_iconv.c,v 1.10 2011/11/19 18:34:21 tnozaki Exp $ */ 3 4/*- 5 * Copyright (c)2003 Citrus Project, 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 329 unchanged lines hidden (view full) --- 339 } 340} 341 342const char 343*_citrus_iconv_canonicalize(const char *name) 344{ 345 char *buf; 346 |
347 if ((buf = malloc((size_t)PATH_MAX)) == NULL) | 347 if ((buf = calloc((size_t)PATH_MAX, sizeof(*buf))) == NULL) |
348 return (NULL); | 348 return (NULL); |
349 memset((void *)buf, 0, (size_t)PATH_MAX); | |
350 _citrus_esdb_alias(name, buf, (size_t)PATH_MAX); 351 return (buf); 352} | 349 _citrus_esdb_alias(name, buf, (size_t)PATH_MAX); 350 return (buf); 351} |