Eliminate a few sprintf calls for printing numbers.

* subversion/mod_dav_svn/merge.c (dav_svn__merge_response): 
  Replace sprintf with apr_psprintf for revision numbers.

* subversion/clients/cmdline/status.c (print_status): 
  Replace sprintf with apr_psprintf for revision numbers. Function
  restructured to avoid compiler warnings about uninitialized variables.

* subversion/clients/cmdline/ls-cmd.c (print_dirents):
  Replace sprintf with apr_psprintf for file size.

* subversion/libsvn_repos/dump.c (write_hash_to_stringbuf): 
  Replace sprintf with apr_psprintf for key and value lengths.

Index: subversion/mod_dav_svn/merge.c
===================================================================
--- subversion/mod_dav_svn/merge.c	(revision 9695)
+++ subversion/mod_dav_svn/merge.c	(arbetskopia)
@@ -208,7 +208,7 @@
   svn_fs_root_t *root;
   svn_error_t *serr;
   const char *vcc;
-  char revbuf[20]; /* long enough for a long int */
+  const char *rev;
   svn_string_t *creationdate, *creator_displayname;
 
   serr = svn_fs_revision_root(&root, repos->fs, new_rev, pool);
@@ -229,7 +229,7 @@
                           NULL, 0 /* add_href */, pool);
 
   /* the version-name of the baseline is the revision number */
-  sprintf(revbuf, "%ld", new_rev);
+  rev = apr_psprintf(pool, "%ld", new_rev);
 
   /* get the creationdate and creator-displayname of the new revision, too. */
   serr = svn_fs_revision_prop(&creationdate, repos->fs, new_rev,
@@ -265,7 +265,7 @@
                         ### we need to tell the client to look at *this*
                         ### resource for the version-name. */
                      "<D:resourcetype><D:baseline/></D:resourcetype>" DEBUG_CR
-                     "<D:version-name>", revbuf, "</D:version-name>" DEBUG_CR,
+                     "<D:version-name>", rev, "</D:version-name>" DEBUG_CR,
                      NULL);
   if (creationdate)
     {
Index: subversion/clients/cmdline/ls-cmd.c
===================================================================
--- subversion/clients/cmdline/ls-cmd.c	(revision 9695)
+++ subversion/clients/cmdline/ls-cmd.c	(arbetskopia)
@@ -65,7 +65,7 @@
           apr_size_t size;
           const char *stdout_author = NULL;
           char timestr[20];
-          char size_buf[21]; /* Enough for 2^64 in base 10 plus '\0' */
+          const char *sizestr;
           
           if (dirent->last_author)
             SVN_ERR (svn_cmdline_cstring_from_utf8 (&stdout_author,
@@ -92,12 +92,12 @@
           if (apr_err)
             timestr[0] = '\0';
 
-          sprintf (size_buf, "%" SVN_FILESIZE_T_FMT, dirent->size);
+          sizestr = apr_psprintf (pool, "%" SVN_FILESIZE_T_FMT, dirent->size);
 
           printf ("%7ld %-8.8s %10s %12s %s%s\n",
                   dirent->created_rev,
                   stdout_author ? stdout_author : " ? ",
-                  (dirent->kind == svn_node_file) ? size_buf : "",
+                  (dirent->kind == svn_node_file) ? sizestr : "",
                   timestr,
                   stdout_entryname,
                   (dirent->kind == svn_node_dir) ? "/" : "");
Index: subversion/clients/cmdline/status.c
===================================================================
--- subversion/clients/cmdline/status.c	(revision 9695)
+++ subversion/clients/cmdline/status.c	(arbetskopia)
@@ -62,15 +62,11 @@
               svn_wc_status_t *status,
               apr_pool_t *pool)
 {
-  char ood_status = '@';    /* Silence a gcc uninitialized warning */
-  char working_rev_buf[21]; /* Enough for 2^64 in base 10 plus '\0' */
-  char commit_rev_buf[21];
-  const char *working_rev = working_rev_buf;
-  const char *commit_rev = commit_rev_buf;
-  const char *commit_author = NULL; /* Silence a gcc uninitialised warning */
-
   if (detailed)
     {
+      char ood_status;
+      const char *working_rev;
+
       if (! status->entry)
         working_rev = "";
       else if (! SVN_IS_VALID_REVNUM (status->entry->revision))
@@ -78,8 +74,7 @@
       else if (status->copied)
         working_rev = "-";
       else
-        sprintf (working_rev_buf, "%ld",
-                 status->entry->revision);
+        working_rev = apr_psprintf (pool, "%ld", status->entry->revision);
 
       if (status->repos_text_status != svn_wc_status_none
           || status->repos_prop_status != svn_wc_status_none)
@@ -89,9 +84,11 @@
 
       if (show_last_committed)
         {
+          const char *commit_rev;
+          const char *commit_author;
+
           if (status->entry && SVN_IS_VALID_REVNUM (status->entry->cmt_rev))
-            sprintf(commit_rev_buf, "%ld",
-                    status->entry->cmt_rev);
+            commit_rev = apr_psprintf(pool, "%ld", status->entry->cmt_rev);
           else if (status->entry)
             commit_rev = " ? ";
           else
@@ -114,33 +111,30 @@
             commit_author = " ? ";
           else
             commit_author = "";
+
+          printf ("%c%c%c%c%c  %c   %6s   %6s %-12s %s\n",
+                  generate_status_code (status->text_status),
+                  generate_status_code (status->prop_status),
+                  status->locked ? 'L' : ' ',
+                  status->copied ? '+' : ' ',
+                  status->switched ? 'S' : ' ',
+                  ood_status,
+                  working_rev,
+                  commit_rev,
+                  commit_author,
+                  path);
         }
+      else
+        printf ("%c%c%c%c%c  %c   %6s   %s\n",
+                generate_status_code (status->text_status),
+                generate_status_code (status->prop_status),
+                status->locked ? 'L' : ' ',
+                status->copied ? '+' : ' ',
+                status->switched ? 'S' : ' ',
+                ood_status,
+                working_rev,
+                path);
     }
-
-  if (detailed && show_last_committed)
-    printf ("%c%c%c%c%c  %c   %6s   %6s %-12s %s\n",
-            generate_status_code (status->text_status),
-            generate_status_code (status->prop_status),
-            status->locked ? 'L' : ' ',
-            status->copied ? '+' : ' ',
-            status->switched ? 'S' : ' ',
-            ood_status,
-            working_rev,
-            commit_rev,
-            commit_author,
-            path);
-
-  else if (detailed)
-    printf ("%c%c%c%c%c  %c   %6s   %s\n",
-            generate_status_code (status->text_status),
-            generate_status_code (status->prop_status),
-            status->locked ? 'L' : ' ',
-            status->copied ? '+' : ' ',
-            status->switched ? 'S' : ' ',
-            ood_status,
-            working_rev,
-            path);
-
   else
     printf ("%c%c%c%c%c  %s\n",
             generate_status_code (status->text_status),
Index: subversion/libsvn_repos/dump.c
===================================================================
--- subversion/libsvn_repos/dump.c	(revision 9695)
+++ subversion/libsvn_repos/dump.c	(arbetskopia)
@@ -45,7 +45,6 @@
                          apr_pool_t *pool)
 {
   apr_hash_index_t *this;      /* current hash entry */
-  char buf[SVN_KEYLINE_MAXLEN];
 
   *strbuf = svn_stringbuf_create ("", pool);
 
@@ -54,7 +53,6 @@
       const void *key;
       void *val;
       apr_ssize_t keylen;
-      int bytes_used;
       svn_string_t *value;
 
       /* Get this key and val. */
@@ -72,23 +70,19 @@
 
       /* Output name length, then name. */
 
-      svn_stringbuf_appendbytes (*strbuf, "K ", 2);
+      svn_stringbuf_appendcstr (*strbuf,
+                                apr_psprintf (pool, "K %" APR_SSIZE_T_FMT "\n",
+                                              keylen));
 
-      sprintf (buf, "%" APR_SSIZE_T_FMT "%n", keylen, &bytes_used);
-      svn_stringbuf_appendbytes (*strbuf, buf, bytes_used);
-      svn_stringbuf_appendbytes (*strbuf, "\n", 1);
-
       svn_stringbuf_appendbytes (*strbuf, (const char *) key, keylen);
       svn_stringbuf_appendbytes (*strbuf, "\n", 1);
 
       /* Output value length, then value. */
 
-      svn_stringbuf_appendbytes (*strbuf, "V ", 2);
+      svn_stringbuf_appendcstr (*strbuf,
+                                apr_psprintf (pool, "V %" APR_SIZE_T_FMT "\n",
+                                              value->len));
 
-      sprintf (buf, "%" APR_SIZE_T_FMT "%n", value->len, &bytes_used);
-      svn_stringbuf_appendbytes (*strbuf, buf, bytes_used);
-      svn_stringbuf_appendbytes (*strbuf, "\n", 1);
-
       svn_stringbuf_appendbytes (*strbuf, value->data, value->len);
       svn_stringbuf_appendbytes (*strbuf, "\n", 1);
     }
@@ -102,7 +96,6 @@
           const void *key;
           void *val;
           apr_ssize_t keylen;
-          int bytes_used;
 
           /* Get this key and val. */
           apr_hash_this (this, &key, &keylen, &val);
@@ -113,12 +106,11 @@
 
           /* Output name length, then name. */
 
-          svn_stringbuf_appendbytes (*strbuf, "D ", 2);
+          svn_stringbuf_appendcstr (*strbuf, 
+                                    apr_psprintf (pool,
+                                                  "D %" APR_SSIZE_T_FMT "\n",
+                                                  keylen));
 
-          sprintf (buf, "%" APR_SSIZE_T_FMT "%n", keylen, &bytes_used);
-          svn_stringbuf_appendbytes (*strbuf, buf, bytes_used);
-          svn_stringbuf_appendbytes (*strbuf, "\n", 1);
-
           svn_stringbuf_appendbytes (*strbuf, (const char *) key, keylen);
           svn_stringbuf_appendbytes (*strbuf, "\n", 1);
         }
