[tor-bugs] #4889 [Tor Client]: Cleanup: use smartlist_add_asprintf() rather than tor_asprintf+smartlist_add()

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Wed Jan 11 19:59:14 UTC 2012


#4889: Cleanup: use smartlist_add_asprintf() rather than
tor_asprintf+smartlist_add()
------------------------+---------------------------------------------------
 Reporter:  nickm       |          Owner:                    
     Type:  defect      |         Status:  needs_review      
 Priority:  normal      |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Client  |        Version:                    
 Keywords:              |         Parent:                    
   Points:              |   Actualpoints:                    
------------------------+---------------------------------------------------
Changes (by nickm):

  * status:  new => needs_review


Comment:

 Renamed the function, and did a big pile of cleanups in branch "bug4889".

 It's a little long, but the changes are all local and straightforward.
 The biggest thing to watch out for would be some case where we did

 {{{
   len = very big thing
   x = tor_malloc(len);
   tor_snprintf(x,len,"foo%s%s...",...);
   append more stuff to x;
 }}}
 and I accidentally replaced it with
 {{{
   tor_asprintf(&x, "foo%s%s...",...);
   append morestuff to x;
 }}}

 But I think I avoided all those cases.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/4889#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list