Commit Graph

29 Commits

Author SHA1 Message Date
Peter Marschall 5abe99d228 fix typos
Mass-typo fixing, almost exclusively in comments and text strings.

While at it also fixed a few (very few) grammar errors.
2018-04-15 09:34:45 +02:00
Frank Morgner 854123c75e fixed binary comparison 2017-11-09 12:42:29 +01:00
Frank Morgner c371c3b5ec removed unused variable 2015-10-14 23:08:39 +02:00
Frank Morgner 0a96616034 remove unused variable 2015-10-14 22:38:10 +02:00
Frank Morgner bcb5fc15e5 honour HAVE_CONFIG_H 2015-04-22 23:55:33 +02:00
Frank Morgner a64326e768 fixed compiler warnings (partially submitted)
Signed-off-by: Frank Morgner <morgner@informatik.hu-berlin.de>

PR-222: commit 0b567dbaa8
partially submitted by Viktor Tarasov
2014-05-03 21:47:15 +02:00
Frank Morgner d21830344f fixed a ton of compiler warnings 2013-08-03 19:15:55 +02:00
Viktor Tarasov 62eb0d05d7 jcop: coverity scan warning RETURN_LOCAL
CID 402623: Pointer to local outside scope (RETURN_LOCAL)
2012-06-11 19:59:36 +02:00
martin 3ab92454a2 card-jcop: remove dummy stubs.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4695 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-05 19:55:00 +00:00
ludovic.rousseau f47416d60e Do not cast the return value of malloc(3) and calloc(3)
From http://en.wikipedia.org/wiki/Malloc#Casting_and_type_safety
" Casting and type safety

malloc returns a void pointer (void *), which indicates that it is a
pointer to a region of unknown data type. One may "cast" (see type
conversion) this pointer to a specific type, as in

int *ptr = (int*)malloc(10 * sizeof (int));

When using C, this is considered bad practice; it is redundant under the
C standard. Moreover, putting in a cast may mask failure to include the
header stdlib.h, in which the prototype for malloc is found. In the
absence of a prototype for malloc, the C compiler will assume that
malloc returns an int, and will issue a warning in a context such as the
above, provided the error is not masked by a cast. On certain
architectures and data models (such as LP64 on 64 bit systems, where
long and pointers are 64 bit and int is 32 bit), this error can actually
result in undefined behavior, as the implicitly declared malloc returns
a 32 bit value whereas the actually defined function returns a 64 bit
value. Depending on calling conventions and memory layout, this may
result in stack smashing.

The returned pointer need not be explicitly cast to a more specific
pointer type, since ANSI C defines an implicit conversion between the
void pointer type and other pointers to objects. An explicit cast of
malloc's return value is sometimes performed because malloc originally
returned a char *, but this cast is unnecessary in standard C
code.[4][5] Omitting the cast, however, creates an incompatibility with
C++, which does require it.

The lack of a specific pointer type returned from malloc is type-unsafe
behaviour: malloc allocates based on byte count but not on type. This
distinguishes it from the C++ new operator that returns a pointer whose
type relies on the operand. (see C Type Safety). "

See also
http://www.opensc-project.org/pipermail/opensc-devel/2010-August/014586.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4636 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-18 15:08:51 +00:00
martin 7ec26d75ae JCOP/BlueZ: remove unused code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4236 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:30:03 +00:00
aj 6545b42c02 cleanup of the debug code:
* reduce to a few, supported functions.
* change all functions to take the debug level as parameter.
* use symbolic names for the debug levels.
* fix tools to pass "verbose"/"opt_debug" as ctx->debug.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4118 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-15 12:17:13 +00:00
aj d22a2483c0 Header file cleanup.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4081 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 08:14:36 +00:00
martin 64f9578202 apdu.sensitive is not in use since [2868]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3751 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-03 09:31:07 +00:00
martin d672fde449 Remove sc_error and sc_ctx_suppress_errors_* in favor of sc_debug/fprintf
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3721 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 08:46:59 +00:00
aj 4acfe6b096 fix compiler/sparse warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3177 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 10:07:01 +00:00
nils 88bae5c923 remove iso logout function, remove dummy logout functions and remove logout call from sc_unlock()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2971 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-17 12:24:04 +00:00
nils 47ee84e72d add functions
void sc_ctx_suppress_errors_on(sc_context_t *ctx);
	void sc_ctx_suppress_errors_off(sc_context_t *ctx);
to turn on/off error suppression (to avoid accessing
sc_context_t directly) and use it.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2671 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-30 19:08:06 +00:00
nils cfc64a494e let src/libopensc/ compile with -Wall -W -Wno-unused-parameter -Werror
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2547 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-07 08:47:13 +00:00
nils f855074c27 check result of sc_file_dup + some cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2499 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-19 17:56:56 +00:00
bert 2d97002824 API fixup: use defined type instead of struct for exposed structs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2232 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-08 20:59:35 +00:00
aet 32b417cbf3 - First stab towards standardized card types
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2172 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-10 10:07:13 +00:00
aet ece96aff98 - Add atrmask to sc_atr_table
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2160 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-09 11:33:37 +00:00
aet 69d2e9014d - Optimize a few cpu cycles from _sc_match_atr_hex
- Replace struct sc_atr_table / _sc_match_atr with
  recently introduced _hex variants
- Rewrote _add_atr
- Introduce int type variable to sc_card_t, so that
  every other card driver won't have to glue around
  with this
- Card driver cleanups, optimize the number of
  sc_match_atr called per card driver. Also
  always try direct match with _sc_match_atr
  first, before relying on eg. historical bytes
  information on some card drivers
- Fixed a memory leak from the miocos driver


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2145 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-06 19:40:40 +00:00
aet bd0f86f69c - Unify all card drivers ATR matching code to use _sc_match_atr_hex,
untested as of yet.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2134 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-04 20:29:35 +00:00
nils e7a0b8f4eb cleanup: declare local functions as static, renamed shadowed variables etc.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2012 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-15 09:35:30 +00:00
aet 85d6bc7922 - Warning fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1731 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-08 15:23:11 +00:00
okir f761d1504f - small jcop driver fix from Chaskiel
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1703 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-29 23:21:47 +00:00
okir 8a4a5f0331 - Added support for JCOP/BlueZ cards, contributed by Chaskiel M Grundman
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1696 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-29 12:28:37 +00:00