[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r884250 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Mon, 21 Dec 2009 15:04:59 +0000

Stefan Sperling wrote:
> - assert(strlen(txn_id) < sizeof(txn->txn_id));
> - strncpy(txn->txn_id, txn_id, sizeof(txn->txn_id) - 1);
> - txn->txn_id[sizeof(txn->txn_id) - 1] = '\0';
> + end = apr_cpystrn(txn->txn_id, txn_id, sizeof(txn->txn_id));
> + if (end < txn->txn_id + strlen(txn_id))
> + return svn_error_createf(SVN_ERR_FS_TXN_NAME_TOO_LONG, NULL,
> + _("Transaction name '%s' was truncated"), txn_id);

The "was truncated" error message is not helpful. (That sounds like the
server is saying, "I have renamed one of your transactions".) Any reason
not to use SVN_ERR_ASSERT?

The logic looks correct.

- Julian
Received on 2009-12-21 16:05:37 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.