/* Line breaking of strings.
- Copyright (C) 2001-2003, 2006-2008 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2006-2009 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This program is free software: you can redistribute it and/or modify it
s, n, offsets, &t, &m)
== 0)
{
- char *q = (char *) malloc (m);
+ char *q = (char *) (m > 0 ? malloc (m) : NULL);
- if (q != NULL)
+ if (m == 0 || q != NULL)
{
size_t i;