Deleted Added
full compact
strfmon.c (331722) strfmon.c (365819)
1/*-
2 * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Copyright (c) 2011 The FreeBSD Foundation
6 * All rights reserved.
7 * Portions of this software were developed by David Chisnall
8 * under sponsorship from the FreeBSD Foundation.

--- 17 unchanged lines hidden (view full) ---

26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Copyright (c) 2011 The FreeBSD Foundation
6 * All rights reserved.
7 * Portions of this software were developed by David Chisnall
8 * under sponsorship from the FreeBSD Foundation.

--- 17 unchanged lines hidden (view full) ---

26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: stable/11/lib/libc/stdlib/strfmon.c 331722 2018-03-29 02:50:57Z eadler $");
34__FBSDID("$FreeBSD: stable/11/lib/libc/stdlib/strfmon.c 365819 2020-09-16 22:55:27Z jhb $");
35
36#include <sys/types.h>
37#include <ctype.h>
38#include <errno.h>
39#include <limits.h>
40#include <locale.h>
41#include <monetary.h>
42#include <stdarg.h>

--- 586 unchanged lines hidden (view full) ---

629 }
630
631 /* do padding with pad_char */
632 if (padded > 0) {
633 bufend -= padded;
634 memset(bufend, pad_char, padded);
635 }
636
35
36#include <sys/types.h>
37#include <ctype.h>
38#include <errno.h>
39#include <limits.h>
40#include <locale.h>
41#include <monetary.h>
42#include <stdarg.h>

--- 586 unchanged lines hidden (view full) ---

629 }
630
631 /* do padding with pad_char */
632 if (padded > 0) {
633 bufend -= padded;
634 memset(bufend, pad_char, padded);
635 }
636
637 bufsize = bufsize - (bufend - rslt) + 1;
637 bufsize = rslt + bufsize - bufend;
638 memmove(rslt, bufend, bufsize);
639 free(avalue);
640 return (rslt);
641}
638 memmove(rslt, bufend, bufsize);
639 free(avalue);
640 return (rslt);
641}